Java Day of getBeginTimeOfDay(Date date, int offset)

Here you can find the source of getBeginTimeOfDay(Date date, int offset)

Description

get Begin Time Of Day

License

Apache License

Declaration

public static long getBeginTimeOfDay(Date date, int offset) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {
    private static final String DATE_FORMAT = "yyyyMMdd";

    public static long getBeginTimeOfDay(Date date, int offset) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);//from   w  w w.  ja v a2  s .  co m
        calendar.add(Calendar.DAY_OF_YEAR, offset);
        date = calendar.getTime();
        SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
        return Long.valueOf(dateFormat.format(date) + "0000");
    }
}

Related

  1. getApisPaxBirthday(String dob)
  2. getBeforeDate(int day)
  3. getBeforeOrAfterDay(Date date, String format, Integer days)
  4. getBeginEndTimeOfDay(Date day)
  5. getBeginOfDay(Date date)
  6. getBirthday(String age)
  7. getBirthDay(String idCard)
  8. getBirthDayDateFormat()
  9. getBirthdayFormatStr(Date date)