Java Hour Calculate getTimestampFromDateHour2(String d)

Here you can find the source of getTimestampFromDateHour2(String d)

Description

get Timestamp From Date Hour

License

Apache License

Declaration

public static long getTimestampFromDateHour2(String d) 

Method Source Code


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

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {
    static final DateFormat HOUR_NAME_FORMAT2 = new SimpleDateFormat("yyyy/MM/dd HH");

    public static long getTimestampFromDateHour2(String d) {
        try {/*from  w w w. j a v a 2  s .c om*/
            return HOUR_NAME_FORMAT2.parse(d).getTime();
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return 0;
    }
}

Related

  1. getDiffDateTime(int diff, int hours)
  2. getDiffHour(String startTime, String endTime)
  3. getDoubleValue(String hours)
  4. getExpiresDate(int hours)
  5. getTime(String dateStr, int hour, String timeZone)
  6. getTimeStringOfHourBefore(int hour)
  7. getTomorrowSixHours()
  8. getWeeHours()
  9. hoursMinsSecsFromMs(long ms)