Here you can find the source of dateTimeToString(Date date)
Parameter | Description |
---|---|
date | datum |
public static final String dateTimeToString(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**// ww w . j av a2 s . co m * Pretvara datum i vrijeme u tekst (format "yyyy-MM-dd HH:mm:ss"). * * @param date datum * @return tekst koji predstavlja taj datum */ public static final String dateTimeToString(Date date) { if (date == null) return ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return sdf.format(date); } }