Java Now nowDateString()

Here you can find the source of nowDateString()

Description

Return a string formatted as yyyyMMddHHmmss

License

Open Source License

Return

String formatted for right now

Declaration

public static String nowDateString() 

Method Source Code


//package com.java2s;
/*//from www .j  ava  2 s.  c o m
 * DateTimeUtils.java
 *
 * Copyright (c) 1998 - 2006 BusinessTechnology, Ltd.
 * All rights reserved
 *
 * This program is the proprietary and confidential information
 * of BusinessTechnology, Ltd. and may be used and disclosed only
 * as authorized in a license agreement authorizing and
 * controlling such use and disclosure
 *
 * Millennium ERP system.
 *
 */

import java.text.SimpleDateFormat;

import java.util.Date;

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

Related

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