Java Day Offset getOffsetDayOffNow(int offset)

Here you can find the source of getOffsetDayOffNow(int offset)

Description

get Offset Day Off Now

License

Apache License

Declaration

public static String getOffsetDayOffNow(int offset) 

Method Source Code


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

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

public class Main {
    public static String getOffsetDayOffNow(int offset) {
        Calendar c = Calendar.getInstance();
        c.add(Calendar.DAY_OF_MONTH, offset);
        return new SimpleDateFormat("yyyy-MM-dd 00:00:00").format(c.getTime());
    }/*from w  ww .jav a 2s  . c o m*/
}

Related

  1. getOffsetDays(String strDate, String strDate2, String pFormat)