Java Date Now getCurrentTimeStamp()

Here you can find the source of getCurrentTimeStamp()

Description

Get the current date and time.

License

Apache License

Return

returns the current date and time in the format: "dd-MM-yyyy_HH_mm_ss"

Declaration

public static String getCurrentTimeStamp() 

Method Source Code


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

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

public class Main {
    /**/*from  www. ja  va  2 s .c  om*/
     * Get the current date and time.
     * 
     * @return returns the current date and time in the format: "dd-MM-yyyy_HH_mm_ss"
     */
    public static String getCurrentTimeStamp() {
        SimpleDateFormat sdfDate = new SimpleDateFormat("dd-MM-yyyy_HH_mm_ss");
        Date now = new Date();
        return sdfDate.format(now);

    }
}

Related

  1. getCurrentTimeInString(String format)
  2. getCurrentTimeNoHour()
  3. getCurrentTimeNumber()
  4. getCurrentTimeOfDay()
  5. getCurrentTimestamp()
  6. getCurrentTimestamp()
  7. getCurrentTimeStamp()
  8. getCurrentTimestamp()
  9. getCurrentTimeStamp()