com.sas.net.util
Class DateConverter

java.lang.Object
  |
  +--com.sas.net.util.DateConverter

public abstract class DateConverter
extends java.lang.Object

This class has methods that convert one date format to another. A date in this case is some value that represents an instant in time to some precision.

Java has a detailed collection of classes for representing dates. The java.util.Date class keeps track of time as the number of milliseconds that have elapsed since midnight on 01Jan1970 GMT. The java.util.Calendar class contain a java.util.Date value but also contains adjustments for time zone and Daylight Savings Time.

CORBA date values measure the elapsed time in units of 100 nanoseconds since 15Oct1582 local time. That was the date that most places starting using the Gregorian Calendar.

IOM DateTime values are in CORBA format.


Constructor Summary
DateConverter()
           
 
Method Summary
static void corbaToJava(long corbaDate, java.util.Calendar localCalendar)
          Convert a CORBA date to a Java date.
static long javaToCorba(java.util.Calendar localDate)
          Convert a Java date value to a CORBA format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateConverter

public DateConverter()
Method Detail

javaToCorba

public static long javaToCorba(java.util.Calendar localDate)
Convert a Java date value to a CORBA format.
Parameters:
localDate - a Java date

corbaToJava

public static void corbaToJava(long corbaDate,
                               java.util.Calendar localCalendar)
Convert a CORBA date to a Java date.
Parameters:
corbaDate - a CORBA date
localCalendar - a java date object intialized with the proper locale and time zone. The appropriate date will be filled in.