6.41. kink/datetime/OFFSET

Provides `offset` type, which is offset of civil time from UTC.

6.41.1. type offset

A offset is an offset of civil time from UTC in Java Time-Scale, with minute precision.

The range of offset is [UTC-18:00, UTC+18:00].

Example:

6.41.1.1. O.op_eq(Arg)

Two offsets are equal when they have the same total minutes.

6.41.1.2. O.total_minutes

“total_minutes” method returns the offset as minutes.

6.41.1.3. O.sign

“sign” method returns the sign mark of the offset.

The method returns "+" if the offset is greater than or equal to zero, or "-" if it is less than zero.

For example,

• Returns "+" for +00:00

• Returns "+" for +08:45

• Returns "-" for -02:30

6.41.1.4. O.hour

“hour” method returns the hour part of the offset when it is analyzed to the sign, hours and minutes.

For example,

• Returns 0 for +00:00

• Returns 8 for +08:45

• Returns 2 for -02:30

Postcondition:

• The result is an int num which is in the range [0, 18]

6.41.1.5. O.minute

“minute” method returns the minute part of the offset when it is analyzed to the sign, hours and minutes.

For example,

• Returns 0 for +00:00

• Returns 45 for +08:45

• Returns 30 for -02:30

Postcondition:

• The result is an int num which is in the range [0, 59]

6.41.1.6. O.repr

`repr` method returns the string representation of the offset.

For example,

• Returns "(offset +00:00)" for +00:00

• Returns "(offset +08:45)" for +08:45

• Returns "(offset -02:30)" for -02:30

6.41.2. OFFSET.new(Total_minutes)

`new` fun makes a `offset` val with Total_minutes as the offset in minutes from UTC.

Preconditions:

• Total_minutes must be an int num

• Total_minutes must be greater than or equal to -1080 (UTC-18:00)

• Total_minutes must be less than or equal to 1080 (UTC+18:00)

6.41.3. OFFSET.is?(Val)

OFFSET.is? returns whether Val is a `offset` val.