Java Date Create toDate()

Here you can find the source of toDate()

Description

to Date

License

Apache License

Declaration

public static String toDate() 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.TimeZone;

public class Main {
    public static final String DEFAULT_DATE_FORMATE = "yyyy-MM-dd HH:mm:ss";

    public static String toDate() {
        return toDate(new Date());
    }/*  w w  w. j a  va2  s .  c om*/

    public static String toDate(Date dt) {
        SimpleDateFormat df = new SimpleDateFormat(DEFAULT_DATE_FORMATE);
        df.setTimeZone(TimeZone.getDefault());
        return df.format(dt);
    }
}

Related

  1. date(int year, int month, int day, int hour, int minute, int second)
  2. longArrayTODateArray(long[] dates_s, SimpleDateFormat dateformat)
  3. longToDate(long time)
  4. objectToDate(Object Obj)
  5. timeToDate()
  6. toDate()
  7. toDate(Calendar date)
  8. toDate(Date d)
  9. toDate(final Calendar calendar)