Java Timestamp Now getTimeStamp()

Here you can find the source of getTimeStamp()

Description

Create logfile TimeStamp

License

Open Source License

Return

[1112749658]

Declaration

public static String getTimeStamp() 

Method Source Code

//package com.java2s;

import java.util.Date;

import java.sql.Timestamp;

public class Main {
    /**/*from  w  ww.  j  av  a  2  s . c om*/
     * Create logfile TimeStamp
     * @return  [1112749658]
     */
    public static String getTimeStamp() {
        Timestamp ts = new Timestamp((new Date()).getTime());
        String strTime = String.valueOf(ts.getTime());
        if (strTime.length() > 10) {
            strTime = strTime.substring(0, 10);
        }
        return strTime;
    }
}

Related

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