Android Date to String Convert toString(Date date)

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

Description

to String

License

Open Source License

Declaration

public final static String toString(Date date) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

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

public class Main {
    public final static String kSimpleDateFormat = "yyyy:DD:MM HH:mm:ss";

    public final static String toString(Date date) {
        if (date == null)
            return "";
        SimpleDateFormat lv_formatter;
        lv_formatter = new SimpleDateFormat(kSimpleDateFormat);
        lv_formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
        return lv_formatter.format(date);
    }//w ww . ja va2s .  c o  m
}

Related

  1. getShortFormat(Date date)
  2. getStringFromDate(Date date)
  3. javaDateToIso8601(Date date)
  4. javaDateToTimeSpan(final Date date)
  5. toGMTDate(Date localDate)
  6. getStrFromDate(Date date)
  7. dateToString(Date date)
  8. dateToString(String format, String date)
  9. dateToString(String format, Date date)