Java tutorial
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.TimeZone; public class Main { public static final DateFormat parser(String format) { return new SimpleDateFormat(format); } private static final DateFormat parser(String format, TimeZone tz) { DateFormat out = parser(format); out.setTimeZone(tz); return out; } }