Java SQL Time Create timeToLong(Object timeObj)

Here you can find the source of timeToLong(Object timeObj)

Description

time To Long

License

Open Source License

Declaration

public static long timeToLong(Object timeObj) 

Method Source Code

//package com.java2s;

import java.sql.Timestamp;

import java.util.Date;

public class Main {
    public static long timeToLong(Object timeObj) {
        long returnVal = 0;
        if (timeObj instanceof Timestamp) {
            returnVal = ((Timestamp) timeObj).getTime();
        } else if (timeObj instanceof Date) {
            returnVal = ((Date) timeObj).getTime();
        }//from w w w .  j a v a  2  s. c  o m
        return returnVal;
    }
}

Related

  1. time2Double(java.sql.Time time)
  2. time2String(final java.sql.Time value)
  3. timeToBytes(Time t)
  4. timeToCalendar(Time input)
  5. timeToInternal(java.sql.Time time)
  6. timeToString(java.sql.Time a_Time, String aS_Format)
  7. timeToString(Time t)
  8. timeToString(Time time)