Java Date Time to String dateTimeToString(Date date)

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

Description

Pretvara datum i vrijeme u tekst (format "yyyy-MM-dd HH:mm:ss").

License

Apache License

Parameter

Parameter Description
date datum

Return

tekst koji predstavlja taj datum

Declaration

public static final String dateTimeToString(Date date) 

Method Source Code


//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);
    }
}

Related

  1. dateTimeToString(Date d)
  2. dateTimeToString(Date d)
  3. dateTimeToString(Date date)
  4. DateTimeToString(Date date)
  5. dateTimeToString(Date date)
  6. dateTimeToString(Date date, String formatter)
  7. dateTimeToString(final Date date)
  8. dateTimeToString(final Date date)
  9. dateTimeToString_mmddyyyy(Date d)