Java DateTimeFormatter formatISOUTCDateTime(long timestamp)

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

Description

format ISOUTC Date Time

License

Open Source License

Declaration

public static String formatISOUTCDateTime(long timestamp) 

Method Source Code

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

import java.time.Instant;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

public class Main {
    public static String formatISOUTCDateTime(long timestamp) {
        ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(
                Instant.ofEpochMilli(timestamp), ZoneOffset.UTC);
        DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE_TIME;
        return formatter.format(zonedDateTime);
    }//from   w ww .  j  a v a  2  s  . c o m
}

Related

  1. formatDate(long timestamp)
  2. formatDate(long timestamp)
  3. formatDateAndTime(String dateAndTime)
  4. formatDateTime(Date dateTime)
  5. formatDateTime(long milis)
  6. formatNow(String format)
  7. formatTime(long milliSeconds)
  8. formatTimestamp(long timestamp)
  9. formatTimestap(final long timestap)