Here you can find the source of getTimestampFromDateHour2(String d)
public static long getTimestampFromDateHour2(String d)
//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; } }