Java Long Number to Time formatToUTC(long datetime)

Here you can find the source of formatToUTC(long datetime)

Description

format To UTC

License

Open Source License

Declaration

public static String formatToUTC(long datetime) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String formatToUTC(long datetime) {
        return formatLongTime(datetime, "yyyyMMdd'T'HHmmss'Z'");
    }/*from  w ww  .  jav  a 2  s  . c  o  m*/

    public static String formatLongTime(long datetime, String format) {
        SimpleDateFormat formatter = new SimpleDateFormat(format);
        return formatter.format(new Date(datetime));
    }
}

Related

  1. elapsedTimeToString(long elapsedTime)
  2. formattaData(long date)
  3. formatTime(long date)
  4. formatTime(long ms)
  5. formatTimestampLong(long timestamp, String datepattern, TimeZone tz)
  6. formatXSDateTime(long lastModified)
  7. getAmPm(long time)
  8. getCollectTimeInLong(Date date)
  9. getDelay(long delay, long interval)