Java Day of nowDayString()

Here you can find the source of nowDayString()

Description

now Day String

License

Apache License

Declaration

public static String nowDayString() 

Method Source Code


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

import java.text.DateFormat;

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

public class Main {
    static DateFormat dayDateFormat = new SimpleDateFormat("yyyy-MM-dd");

    public static String nowDayString() {
        return dayDateFormat.format(dateTimeConvert(0));
    }//from   ww w  .j  a  v  a2s. c o m

    public static Date dateTimeConvert(int minute) {
        Date date = new Date();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.set(Calendar.MINUTE, calendar.get(Calendar.MINUTE) + minute);
        return calendar.getTime();
    }
}

Related

  1. lastDays(int count)
  2. long2StringPerDay(long t, SimpleDateFormat sdf)
  3. minDayToLong(String time)
  4. minusDate(int day, int type)
  5. nextDay(Date date)
  6. parseBirthday(String r)
  7. parseCalendarDayFormat(String strDate)
  8. parseDay(Date value, String defaultValue)
  9. parseDay(final String day)