Java Timestamp generateTimestamp()

Here you can find the source of generateTimestamp()

Description

Generate timestamp.

License

Apache License

Return

timestamp

Declaration

public static Timestamp generateTimestamp() 

Method Source Code


//package com.java2s;
/*/*from  w ww.j  av a2 s .com*/
 *    Copyright 2003, 2004, 2005, 2006 Research Triangle Institute
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 */

import java.sql.Timestamp;

public class Main {
    /**
     * Generate timestamp.
     * @return timestamp
     */
    public static Timestamp generateTimestamp() {
        java.sql.Timestamp now = new java.sql.Timestamp(System.currentTimeMillis());
        return now;
    }
}

Related

  1. endOfMonth(java.sql.Timestamp dd)
  2. extractDateSystemTimeStamp()
  3. floorAsDate(Timestamp time)
  4. fromDate(Timestamp timestamp)
  5. fromTimestamp(Timestamp timestamp)
  6. getBeforeDate(final Timestamp baseTime, final int period, final int unit)
  7. getCalendarTimestamp(Calendar cal)
  8. getCurentTimestamp()
  9. getCurFullTimestampStr()