Java Day getDayEndTime(int off, String timezone)

Here you can find the source of getDayEndTime(int off, String timezone)

Description

get Day End Time

License

Apache License

Declaration

public static String getDayEndTime(int off, String timezone) 

Method Source Code

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

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

public class Main {
    public static String getDayEndTime(int off, String timezone) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(new Date().getTime());
        calendar.add(5, off);//from  w  w  w  .j  av a  2  s . c  o m
        SimpleDateFormat dateFormatGmt = new SimpleDateFormat("yyyy-MM-dd 23:59:59");
        dateFormatGmt.setTimeZone(TimeZone.getTimeZone(timezone));
        return dateFormatGmt.format(calendar.getTime());
    }
}

Related

  1. getDayBegin(Date date)
  2. getDayBetween(String firstDay, String secondDay)
  3. getDayDate(String date, String formatFormat)
  4. getDayDesc(Date arg)
  5. getDayEnd(Date date)
  6. getDayForDate(String dateToCheck, String pattern)
  7. getDayFormat(Date date)
  8. getDayInWeekBeginAndEnd(Date date)
  9. getDayInWeekForMonthIn2Characters(int year, int month)