Here you can find the source of millisecondsToISO8601(long date)
Parameter | Description |
---|---|
date | milliseconds since the epoch |
public static String millisecondsToISO8601(long date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/*w w w . ja v a 2s .c om*/ * A date format for IS8601 date and time representation. This representation * is to the millisecond in UTC time. */ private static final SimpleDateFormat ISO8601_DATE_FORMAT = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); /** * Converts the date and time provided in numbers of milliseconds since the * epoch to a ISO8601 date and time representation (UTC to the millisecond). * * @param date milliseconds since the epoch * @return ISO8601 date and time * @since 1.3 */ public static String millisecondsToISO8601(long date) { return ISO8601_DATE_FORMAT.format(new Date(date)); } }