Here you can find the source of getTimestamp(String dateValue, String pattern, TimeZone timezone)
private static long getTimestamp(String dateValue, String pattern, TimeZone timezone) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.TimeZone; public class Main { private static long getTimestamp(String dateValue, String pattern, TimeZone timezone) throws ParseException { DateFormat d = new SimpleDateFormat(pattern); Calendar c = Calendar.getInstance(timezone); c.setTime(d.parse(dateValue));//w ww . ja v a2 s . c om return c.getTimeInMillis(); } }