Java Date Now getCurrentUTCDate()

Here you can find the source of getCurrentUTCDate()

Description

get Current UTC Date

License

Open Source License

Declaration

public static String getCurrentUTCDate() 

Method Source Code


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

import java.text.DateFormat;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import java.util.TimeZone;

public class Main {
    private static final String STANDARD_DATE_FORMAT_STRING = "yyyy-MM-dd'T'HH:mm:ss'Z'";

    public static String getCurrentUTCDate() {
        Calendar cal = Calendar.getInstance();
        DateFormat df = new SimpleDateFormat(STANDARD_DATE_FORMAT_STRING);
        df.setTimeZone(TimeZone.getTimeZone("GMT"));
        return df.format(cal.getTime());
    }//  w  w w .  jav  a2s .c om
}

Related

  1. getCurrentTimeStr()
  2. getCurrentTimeString(String format)
  3. getCurrentTimeString(String pattern)
  4. getCurrentToNextDaySecond()
  5. getCurrentUnixTime()
  6. getCurrentUtcDate()
  7. getCurrentUTCSeconds(Date current)
  8. getCurrentUTCString()
  9. getCurrentUTCTime()