Java Hour getLastHour()

Here you can find the source of getLastHour()

Description

get Last Hour

License

Open Source License

Declaration

public static String getLastHour() 

Method Source Code

//package com.java2s;

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

public class Main {

    public static String getLastHour() {
        SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHH");
        Calendar cl = Calendar.getInstance();
        cl.set(cl.get(cl.YEAR), cl.get(cl.MONTH), cl.get(cl.DAY_OF_MONTH), cl.get(cl.HOUR_OF_DAY) - 1, 0, 0);
        return sf.format(cl.getTime());
    }//from w  w w . j a va 2 s .  com
}

Related

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