Java Date Create toDateStr(Object o)

Here you can find the source of toDateStr(Object o)

Description

to Date Str

License

Apache License

Declaration

public static String toDateStr(Object o) throws ParseException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String toDateStr(Object o) throws ParseException {
        return o == null ? null : new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((Date) o);
    }//ww w .j  av  a  2 s  . c o  m
}

Related

  1. toDateHeader(long value)
  2. toDateList(Collection list)
  3. toDateQueryFormat(Date value)
  4. toDateStr(Date d)
  5. ToDateStr(Date dt)
  6. toDateText(Date date)
  7. toDateTime(Date date)
  8. toDatetime(long value)