Java Date Now getCurrentDate()

Here you can find the source of getCurrentDate()

Description

Returns the current date in Cordys format.

License

Apache License

Declaration

public static String getCurrentDate() 

Method Source Code


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

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    /**//  www  .ja  v a 2 s  . c o  m
     * Holds the format of a Cordys Date String
     */
    public static final String CORDYS_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";

    /**
     * Returns the current date in Cordys format.
     * @return
     */
    public static String getCurrentDate() {
        String returnValue = null;

        SimpleDateFormat targetFormat = new SimpleDateFormat(CORDYS_DATE_FORMAT);
        returnValue = targetFormat.format(new Date());

        return returnValue;
    }
}

Related

  1. getCurrentDate()
  2. getCurrentDate()
  3. getCurrentDate()
  4. getCurrentDate()
  5. getCurrentDate()
  6. getCurrentDate()
  7. getCurrentDate()
  8. getCurrentDate()
  9. getCurrentDate()