Java Hour getLasthour()

Here you can find the source of getLasthour()

Description

get Lasthour

License

Apache License

Declaration

public static String getLasthour() 

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 getLasthour() {
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.HOUR_OF_DAY, -1);
        String yesterday = new SimpleDateFormat("yyyy-MM-dd HH").format(cal.getTime());
        return yesterday;
    }//from w w w  .  j  a  v a 2 s  .c  om
}

Related

  1. getHours(final Date date)
  2. getHours(java.util.Date _date)
  3. getHoursByDate(Date date, int hours)
  4. getHoursOfTowDiffDate(String p_startDate, String p_endDate)
  5. getLastHour()
  6. getMinOfHour(long l1)
  7. getPreHour()
  8. getPreHourText(String pattern)
  9. getPrevHour(Date date)