List of utility methods to do GMT Date Get
String | getGMTDate() get GMT Date return getGMTDate(new Date()); |
String | getGMTDate(Date date) get GMT Date if (date == null) { return null; DateFormat dateFormat = new SimpleDateFormat( "E, dd MMM yyyy HH:mm:ss 'GMT'", Locale.ENGLISH); dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); String dateStr = dateFormat.format(date); return dateStr; ... |
Date | getGMTDateFromString(String dateStr) get GMT Date From String return getDateFromString("E, dd MMM yyyy HH:mm:ss 'GMT'", dateStr); |
long | getMillisGMT() get Millis GMT Calendar calendar = new GregorianCalendar(); TimeZone mTimeZone = calendar.getTimeZone(); int offset = mTimeZone.getOffset(System.currentTimeMillis()); return System.currentTimeMillis() - offset; |
String | millisToGMT(long millis) millis To GMT SimpleDateFormat df = new SimpleDateFormat("MM_dd_yyyy_hh_mm", Locale.getDefault()); df.setTimeZone(TimeZone.getTimeZone("GMT")); return df.format(millis) + "_UTC"; |