dk.vajhoej.record
Class TimeUtil

java.lang.Object
  extended by dk.vajhoej.record.TimeUtil

public class TimeUtil
extends java.lang.Object

Class TimeUtil converts between integers in various time formats and Date objects.


Constructor Summary
TimeUtil()
           
 
Method Summary
static java.util.Date fromJavaTime(long v)
          Convert from long with Java time (milliseconds since 1-Jan-1970) to Date object.
static java.util.Date fromUnixTime(int v)
          Convert from int with Unix time (seconds since 1-Jan-1970) to Date object.
static java.util.Date fromVMSTime(long v)
          Convert from long with VMS time (100 nanoseconds since 17-Nov-1858) to Date object.
static long toJavaTime(java.util.Date d)
          Convert from Date object to long with Java time (milliseconds since 1-Jan-1970).
static int toUnixTime(java.util.Date d)
          Convert from Date object to int with Unix time (seconds since 1-Jan-1970).
static long toVMSTime(java.util.Date d)
          Convert from Date object to long with VMS time (100 nanoseconds since 17-Nov-1858).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeUtil

public TimeUtil()
Method Detail

fromJavaTime

public static java.util.Date fromJavaTime(long v)
Convert from long with Java time (milliseconds since 1-Jan-1970) to Date object.

Parameters:
v - Java time
Returns:
Date object

toJavaTime

public static long toJavaTime(java.util.Date d)
Convert from Date object to long with Java time (milliseconds since 1-Jan-1970).

Parameters:
d - Date object
Returns:
Java time

fromUnixTime

public static java.util.Date fromUnixTime(int v)
Convert from int with Unix time (seconds since 1-Jan-1970) to Date object.

Parameters:
v - Unix time
Returns:
Date object

toUnixTime

public static int toUnixTime(java.util.Date d)
Convert from Date object to int with Unix time (seconds since 1-Jan-1970).

Parameters:
d - Date object
Returns:
Unix time

fromVMSTime

public static java.util.Date fromVMSTime(long v)
Convert from long with VMS time (100 nanoseconds since 17-Nov-1858) to Date object.

Parameters:
v - VMS time
Returns:
Date object

toVMSTime

public static long toVMSTime(java.util.Date d)
Convert from Date object to long with VMS time (100 nanoseconds since 17-Nov-1858).

Parameters:
d - Date object
Returns:
VMS time