Java Date Format dateTime2String(Date value)

Here you can find the source of dateTime2String(Date value)

Description

date Time String

License

Open Source License

Parameter

Parameter Description
value Date

Return

String

Declaration

public static String dateTime2String(Date value) 

Method Source Code

//package com.java2s;
/*//from w  w w.j a  v a2 s  .co  m
 * Copyright (C) 2010 Viettel Telecom. All rights reserved.
 * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**
     *
     * @param value Date
     * @return String
     */
    public static String dateTime2String(Date value) {
        if (value != null) {
            SimpleDateFormat dateTime = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
            return dateTime.format(value);
        }
        return "";
    }
}

Related

  1. dateFormatTime(final Date date)
  2. dateFormatToString(Date date, String format)
  3. dateFormatToString(String source, String format)
  4. dateFormatUTC()
  5. dateTime2Str(Date date, String pattern)
  6. dateTime2StringFs(Date date)
  7. dateTimeFormat(Date dateTime)
  8. DateTimeFormat(final Date date)
  9. dateTimeFormatterDate(Date date)