Tuesday, 2 July 2013

Timestamps in Java



package com.javastoreroom.in;
import java.sql.Timestamp;
import java.util.Date;
public class TimeStamp {
 
    public static void main(String[] args) {
 
     /**
      * @see currentTimeMillis() Returns the current time in milliseconds.
      */
     
     Date date=new Timestamp(System.currentTimeMillis());
     System.out.println(date);
  
 }
 
}
Output ...