Java Date ISO Parse toIsoString(Date date)

Here you can find the source of toIsoString(Date date)

Description

Returns the given Date as a String in ISO 8601 format.

License

Open Source License

Declaration

public static String toIsoString(Date date) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private static final SimpleDateFormat ISO_8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SZ");

    /**//from  w  w w. j a  v  a  2 s. co  m
     * Returns the given Date as a String in ISO 8601 format.
     */
    public static String toIsoString(Date date) {
        synchronized (ISO_8601) {
            return ISO_8601.format(date);
        }
    }
}

Related

  1. time2StringISO(Date date)
  2. timestampAsIsoString(long timestamp)
  3. toCalendar(final String iso8601string)
  4. toDate(String isoDate)
  5. toIsoString(Calendar value)
  6. toStringForComparison(Date date)
  7. tryParse(String isoDateTime)