Java Date Format ISO toIso8601(Date dateObj)

Here you can find the source of toIso8601(Date dateObj)

Description

to Iso

License

Open Source License

Declaration

public static String toIso8601(Date dateObj) 

Method Source Code

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

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

public class Main {
    private static final SimpleDateFormat DF = new SimpleDateFormat(
            "yyyy-MM-dd'T'HH:mm:ssZ");

    public static String toIso8601(Date dateObj) {
        DF.setTimeZone(TimeZone.getTimeZone("UTC"));
        return DF.format(dateObj).replaceAll("\\+0000$", "Z");
    }//from  www .j av  a  2s. co m
}

Related

  1. toISO8601(Date date)
  2. toISO8601(Date date)
  3. toIso8601(Date date)
  4. toISO8601(Date date)
  5. toISO8601(Date date)
  6. toIso8601(Date dateTime)
  7. toISO8601(Date pDate)
  8. toISO8601FileSystemCompatible(Calendar calendar)
  9. toISODate(String format, String value)