Java Timestamp Format format(Date timestamp)

Here you can find the source of format(Date timestamp)

Description

Formats the given timestamp according OGC standard

License

Open Source License

Parameter

Parameter Description
timestamp a parameter

Declaration

public static String format(Date timestamp) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.TimeZone;

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

    /**/*from w ww. j ava 2s.  c o  m*/
     * Formats the given timestamp according OGC standard
     *
     * @param timestamp
     * @return
     */
    public static String format(Date timestamp) {
        SimpleDateFormat formatter = new SimpleDateFormat(zuluFormat);
        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
        return formatter.format(timestamp);
    }
}

Related

  1. format(BigDecimal data)
  2. format(Date aTs_Datetime)
  3. format(Date date)
  4. format(Date date, String format)
  5. format(Date time, String pattern)
  6. format(Date timestamp, String format)
  7. Format(DateFormat format, Timestamp time)
  8. format(final Date date)
  9. format(final long unixTimeStamp)