Java Timestamp Create getTimestamp()

Here you can find the source of getTimestamp()

Description

Returns a timestamp that is set to the time when DataLoader was started.

License

Open Source License

Return

The timestamp string

Declaration

public static String getTimestamp() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    private static String timestamp = null;

    /**// w  w  w.jav  a 2  s  .  com
     * Returns a timestamp that is set to the time when DataLoader was started. This allows for the same
     * timestamp to be used throughout the same session.
     *
     * @return The timestamp string
     */
    public static String getTimestamp() {
        if (timestamp == null) {
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss");
            timestamp = dateFormat.format(new Date());
        }
        return timestamp;
    }
}

Related

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