Java Now nowDateString(String format)

Here you can find the source of nowDateString(String format)

Description

Return a string formatted as format

License

Apache License

Return

String formatted for right now

Declaration

public static String nowDateString(String format) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String nowDateString() {
        return nowDateString("yyyy.MM.dd HH:mm:ss");
    }/*from  www.j  av a 2  s .  co m*/

    /**
     * Return a string formatted as format
     *
     * @return String formatted for right now
     */
    public static String nowDateString(String format) {
        SimpleDateFormat df = new SimpleDateFormat(format);
        return df.format(new Date());
    }
}

Related

  1. nowDate()
  2. nowDate(final String formatter)
  3. nowDate(String strFormat)
  4. nowDateString()
  5. nowDateString()
  6. nowDateToString()
  7. nowDT()
  8. nowDT()
  9. nowFile()