com.jacob.com

## Class DateUtilities

- java.lang.Object
- - com.jacob.com.DateUtilities

-     public class DateUtilities
      extends java.lang.Object

  java / windows date conversion utilities
  Author:
    joe

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DateUtilities()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static double` | `convertDateToWindowsTime(java.util.Date javaDate)` converts a java date to a windows time object (is this timezone safe?)
    `static double` | `convertMillisecondsToWindowsTime(long milliseconds)` Convert a Java time to a COM time.
    `static java.util.Date` | `convertWindowsTimeToDate(double comTime)` converts a windows time to a Java Date Object
    `static long` | `convertWindowsTimeToMilliseconds(double comTime)` Convert a COM time from functions Date(), Time(), Now() to a Java time (milliseconds).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DateUtilities

          public DateUtilities()

  - ### Method Detail

    - #### convertWindowsTimeToDate

          public static java.util.Date convertWindowsTimeToDate(double comTime)

      converts a windows time to a Java Date Object
      Parameters:
        `comTime` -
      Returns:
        Date object representing the windows time as specified in comTime

    - #### convertWindowsTimeToMilliseconds

          public static long convertWindowsTimeToMilliseconds(double comTime)

      Convert a COM time from functions Date(), Time(), Now() to a Java time (milliseconds). Visual Basic time values are based to 30.12.1899, Java time values are based to 1.1.1970 (= 0 milliseconds). The difference is added to the Visual Basic value to get the corresponding Java value. The Visual Basic double value reads: .<1 day percentage fraction>, e.g. "38100.6453" means: 38100 days since 30.12.1899 plus (24 hours * 0.6453). Example usage: `Date javaDate = new Date(toMilliseconds (vbDate));`.
      Parameters:
        `comTime` - COM time.
      Returns:
        Java time.

    - #### convertDateToWindowsTime

          public static double convertDateToWindowsTime(java.util.Date javaDate)

      converts a java date to a windows time object (is this timezone safe?)
      Parameters:
        `javaDate` - the java date to be converted to windows time
      Returns:
        the double representing the date in a form windows understands

    - #### convertMillisecondsToWindowsTime

          public static double convertMillisecondsToWindowsTime(long milliseconds)

      Convert a Java time to a COM time.
      Parameters:
        `milliseconds` - Java time.
      Returns:
        COM time.

http://jacob-project.sourceforge.net