Java Date ISO Parse timestampAsIsoString(long timestamp)

Here you can find the source of timestampAsIsoString(long timestamp)

Description

timestamp As Iso String

License

Apache License

Declaration

public static String timestampAsIsoString(long timestamp) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.TimeZone;

public class Main {
    public static String timestampAsIsoString(long timestamp) {
        return dateAsIsoString(new Date(timestamp));
    }//  ww  w. j  a  v  a 2  s. c om

    public static String dateAsIsoString(Date date) {
        TimeZone tz = TimeZone.getDefault();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
        df.setTimeZone(tz);
        return df.format(date);
    }
}

Related

  1. parseISODuration(String duration)
  2. parseIsoString(String time)
  3. parseTimestampIso8601(String timestamp)
  4. strongCheckIso8601Date(String date)
  5. time2StringISO(Date date)
  6. toCalendar(final String iso8601string)
  7. toDate(String isoDate)
  8. toIsoString(Calendar value)
  9. toIsoString(Date date)