TibrvDate.setTime()

Method

Declaration

void setTime(long milliseconds)
void setTime(
    long  seconds,
    int   nanoseconds)

Purpose

Change the value of a date object.

Remarks

If the time value specified is out of range, this constructor throws an IllegalArgumentException.

Parameter

Description

milliseconds

Set the date from this value (in milliseconds, centered on 12:00am, January 1, 1970).

seconds

Set the a date from this value (in seconds, centered on 12:00am, January 1, 1970). This argument must be in the range [TibrvDate.MIN_SECONDS;TibrvDate.MAX_SECONDS].

nanoseconds

Add this value (in nanoseconds) to the time specified by the seconds parameter. This argument must be non-negative, in the range [0;999999999].

Method Forms

With one argument, interpret it as the date in milliseconds. For example, specify the time 1/2 second before midnight of December 31, 1969 as -500 milliseconds.

With two arguments, interpret them as seconds and (non-negative) nanoseconds. For example, specify the time 1/2 second before midnight of December 31, 1969 as -1 seconds plus 500,000,000 nanoseconds.

See Also

Representations