Android Date to String Convert toUTCFormattedString(Date date)

Here you can find the source of toUTCFormattedString(Date date)

Description

to UTC Formatted String

Declaration

public static String toUTCFormattedString(Date date) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.TimeZone;

public class Main {
    public static String toUTCFormattedString(Date date) {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");
        df.setTimeZone(TimeZone.getTimeZone("UTC"));
        return df.format(date);
    }//  w w w .  j a  v a2 s.c  om
}

Related

  1. datesToString(final Date start, final int duration)
  2. datesToString(final Date start, final int duration)
  3. convertDateToString(Date date)
  4. toSimpleDateFormattedString(Date date)
  5. toStringFromDate(Date date)
  6. updateDate(DatePicker picker, Date date)
  7. date2String(Date date, String s)
  8. date2String(int i, int j, int k)