Java Timestamp Now getCurrentTimeStamp()

Here you can find the source of getCurrentTimeStamp()

Description

get Current Time Stamp

License

Open Source License

Declaration

public static Timestamp getCurrentTimeStamp() 

Method Source Code


//package com.java2s;
/*//  w  ww.  j a v a 2 s  .  co m
 * Copyright (c) 2015 Stephan D. Cote' - All rights reserved.
 * 
 * This program and the accompanying materials are made available under the 
 * terms of the MIT License which accompanies this distribution, and is 
 * available at http://creativecommons.org/licenses/MIT/
 *
 * Contributors:
 *   Stephan D. Cote 
 *      - Initial concept and implementation
 */

import java.sql.Timestamp;

public class Main {
    public static Timestamp getCurrentTimeStamp() {
        return getTimeStamp(new java.util.Date());
    }

    public static Timestamp getTimeStamp(java.util.Date date) {
        return new Timestamp(date.getTime());
    }
}

Related

  1. getCurrentTimestamp()
  2. getCurrentTimestamp()
  3. getCurrentTimestamp()
  4. getCurrentTimeStamp()
  5. getCurrentTimestamp()
  6. getCurrentTimestamp()
  7. getCurrentTimestamp()
  8. getCurrentTimeStamp(int offsetDays)
  9. getCurrentTimeStamp(String format)