Java Timestamp Create getTimeStamp()

Here you can find the source of getTimeStamp()

Description

Get the current date and time (useful for logs, is thread safe).

License

Open Source License

Return

a string containing the current date and time

Declaration

public static String getTimeStamp() 

Method Source Code

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

import java.util.*;

import java.text.*;

public class Main {
    /**/*from www  . j a v a2 s  . com*/
     * Get the current date and time (useful for logs, is thread safe).
     * @return a string containing the current date and time
     */
    public static String getTimeStamp() {
        return new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy")
                .format(new Date(System.currentTimeMillis()));
    }
}

Related

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