Java Timestamp Convert To TimestampToBigint(String timestamp)

Here you can find the source of TimestampToBigint(String timestamp)

Description

Convert a string timestamp value to big integer.

License

Open Source License

Parameter

Parameter Description
String timestamp

Declaration

public static BigInteger TimestampToBigint(String timestamp) 

Method Source Code

//package com.java2s;
/**//from ww w.  ja  v a  2  s. c  o m
 * (c) 2014 Cisco and/or its affiliates. All rights reserved.
 * 
 * This software is released under the Eclipse Public License. The details can be found in the file LICENSE. 
 * Any dependent libraries supplied by third parties are provided under their own open source licenses as 
 * described in their own LICENSE files, generally named .LICENSE.txt. The libraries supplied by Cisco as 
 * part of the Composite Information Server/Cisco Data Virtualization Server, particularly csadmin-XXXX.jar, 
 * csarchive-XXXX.jar, csbase-XXXX.jar, csclient-XXXX.jar, cscommon-XXXX.jar, csext-XXXX.jar, csjdbc-XXXX.jar, 
 * csserverutil-XXXX.jar, csserver-XXXX.jar, cswebapi-XXXX.jar, and customproc-XXXX.jar (where -XXXX is an 
 * optional version number) are provided as a convenience, but are covered under the licensing for the 
 * Composite Information Server/Cisco Data Virtualization Server. They cannot be used in any way except 
 * through a valid license for that product.
 * 
 * This software is released AS-IS!. Support for this software is not covered by standard maintenance agreements with Cisco. 
 * Any support for this software by Cisco would be covered by paid consulting agreements, and would be billable work.
 * 
 */

import java.math.BigInteger;

import java.sql.Timestamp;

public class Main {
    /**
     * Convert a string timestamp value to big integer.
     * 
     * @param String timestamp
     * @return
     */
    public static BigInteger TimestampToBigint(String timestamp) {
        BigInteger result = BigInteger.valueOf(new Long(Timestamp.valueOf(timestamp).getTime()));
        return result;
    }

    /**
     * Convert a timestamp value to big integer.
     * 
     * @param Timestamp timestamp
     * @return
     */
    public static BigInteger TimestampToBigint(Timestamp timestamp) {
        BigInteger result = BigInteger.valueOf(new Long(timestamp.getTime()));
        return result;
    }
}

Related

  1. timestamp2Calendar(Timestamp ts)
  2. timestamp2Date(java.sql.Timestamp t)
  3. timestamp2Internal(java.sql.Timestamp t)
  4. timestamp2ToTimestamp(long seconds, int fraction, int width)
  5. timestampSqlToDate(Timestamp timestamp)
  6. timeStampToBytes(Timestamp ts)
  7. timestampToCalendar(java.sql.Timestamp inTime)
  8. timestampToCalendar(Timestamp time)
  9. TimestampToDate(Integer time)