Java Timestamp Create toTimestamp(long value)

Here you can find the source of toTimestamp(long value)

Description

to Timestamp

License

Open Source License

Declaration

public static java.sql.Timestamp toTimestamp(long value) 

Method Source Code

//package com.java2s;
/**/* ww w  . ja va  2s  . c  o  m*/
 * Project: ${puma-server.aid}
 * 
 * File Created at 2012-6-11 $Id$
 * 
 * Copyright 2010 dianping.com. All rights reserved.
 * 
 * This software is the confidential and proprietary information of Dianping
 * Company. ("Confidential Information"). You shall not disclose such
 * Confidential Information and shall use it only in accordance with the terms
 * of the license agreement you entered into with dianping.com.
 */

public class Main {
    public static java.sql.Timestamp toTimestamp(long value) {
        if (value <= 1) {
            return new java.sql.Timestamp(1000);
        }
        return new java.sql.Timestamp(value * 1000L);
    }
}

Related

  1. toTimestamp(final int year, final int month, final int dayOfMonth, final int hour, final int minute, final int second, final int millsecond)
  2. toTimestamp(final java.sql.Date date)
  3. toTimestamp(final String pValue)
  4. toTimestamp(java.sql.Date date)
  5. toTimestamp(long ts)
  6. toTimestamp(Object dateobj)
  7. toTimestamp(Object objInParam)
  8. toTimestamp(String _sDate)
  9. toTimestamp(String dateTime)