Java Date Now getCurrentCacheTime()

Here you can find the source of getCurrentCacheTime()

Description

get Current Cache Time

License

Open Source License

Return

The current time in cache format

Declaration

public static final String getCurrentCacheTime() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Locale;

import java.util.TimeZone;

public class Main {
    public static final String cacheValidatorTimePattern = "EEE, dd MMM yyyy HH:mm:ss 'GMT'";
    public static final Locale cacheValidatorTimeLocale = Locale.US;
    public static final TimeZone cacheValidatorTimeFormat = TimeZone.getTimeZone("GMT");

    /** @return The current time in cache format */
    public static final String getCurrentCacheTime() {
        return getCacheValidatorTimeFormat().format(new Date());
    }/* ww w  .  ja  v  a  2 s .  com*/

    public static final SimpleDateFormat getCacheValidatorTimeFormat() {
        SimpleDateFormat rtrn = new SimpleDateFormat(cacheValidatorTimePattern, cacheValidatorTimeLocale);
        rtrn.setTimeZone(cacheValidatorTimeFormat);
        return rtrn;
    }
}

Related

  1. currentXdsDate(int format)
  2. getCurrent()
  3. getCurrent()
  4. getCurrentAccurateDateTimeStringForPrint()
  5. getCurrentAgeByBirthdate(String brithday)
  6. getCurrentCalendar()
  7. getCurrentCompactTime()
  8. getCurrentDataInFormat(String pattern)
  9. getCurrentDataTimePrettyFilesystem()