Java Timestamp Create createTimestampFormat()

Here you can find the source of createTimestampFormat()

Description

create Timestamp Format

License

Open Source License

Declaration

private static SimpleDateFormat createTimestampFormat() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;

public class Main {
    private static SimpleDateFormat createTimestampFormat() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
        GregorianCalendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
        // We use Proleptic Gregorian Calendar (i.e., Gregorian calendar extends
        // backwards to year one) for timestamp formating.
        calendar.setGregorianChange(new Date(Long.MIN_VALUE));
        sdf.setCalendar(calendar);/*ww w  . j a  v  a 2 s .c  o  m*/
        return sdf;
    }
}

Related

  1. createTimeStamp()
  2. createTimestamp(final int aYear, final int aMonth, final int aDate, final int aHour, final int aMinute, final int aSecond)
  3. createTimestamp(final int year, final int month, final int day, final int hour, final int minute, final int second)
  4. createTimestamp(int month, int day)
  5. createTimestampedZipFilename(String prefix)
  6. createTimeStamps()
  7. getTimestamp()
  8. getTimestamp()
  9. getTimestamp()