Java Timestamp nowAsTimestamp()

Here you can find the source of nowAsTimestamp()

Description

Get now time as timestamp

License

LGPL

Return

timestamp object

Declaration

public static Timestamp nowAsTimestamp() 

Method Source Code


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

import java.sql.Timestamp;

public class Main {
    /**/*  w  w  w . j ava 2 s  .  co  m*/
     * Get now time as timestamp
     * @return timestamp object
     */
    public static Timestamp nowAsTimestamp() {
        return new Timestamp(nowAsLong());
    }

    /**
     * Get now time as long
     * @return long
     */
    public static long nowAsLong() {
        return System.currentTimeMillis();
    }
}

Related

  1. minusOneSecond(Timestamp now)
  2. newDate(Timestamp time)
  3. newTimestamp()
  4. newTimestamp(Date date)
  5. normalizeDateTimeAsTimestamp(Date changedDate, Locale locale)
  6. nowUtcTimestamp()
  7. objToTimeStamp(Object obj)
  8. printFull(Timestamp ts)
  9. quoteMySQLDataField(Timestamp fieldData)