Java Timestamp Convert To timestamp(Timestamp timestamp)

Here you can find the source of timestamp(Timestamp timestamp)

Description

timestamp

License

Open Source License

Declaration


public static long timestamp(Timestamp timestamp) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.sql.Timestamp;

public class Main {

    public static long timestamp(Timestamp timestamp) {
        if (timestamp == null)
            return 0;

        return timestamp.getTime();
    }//from  ww w .  ja v a2  s .  c  om

    public static Timestamp timestamp(long time) {
        if (time == 0)
            return null;

        return new Timestamp(time);
    }
}

Related

  1. convertToDate(Timestamp aTimeStamp)
  2. convertToDate(Timestamp timestamp)
  3. convertToEpochMillis(java.sql.Timestamp ts)
  4. convertToISO8601String(java.sql.Timestamp ts)
  5. convertToString(Timestamp dateData, String pattern, Locale locale)
  6. Timestamp2Arch(Timestamp ts)
  7. timestamp2Calendar(Timestamp ts)
  8. timestamp2Date(java.sql.Timestamp t)
  9. timestamp2Internal(java.sql.Timestamp t)