up: TIME     index Zimbu documentation

CLASS TIME.Values @public

summary

     

Broken-down values of a moment in time.

Second resolution.

Example:

 IO.print(TIME.Values.NEW().ToString())
Equivalent to:
 IO.print(TIME.Values.NEW(TIME.current()).ToString())

int  $usec @public  microseconds, 0 - 999'999
int  $sec @public  seconds, 0 - 59
int  $min @public  minutes, 0 - 59
int  $hour @public  hour, 0 - 23
int  $day @public  day of the month, 1 - 31
int  $month @public  month, 1 - 12
int  $year @public  year, negative for BC
int  $weekDay @public  day of the week, 1 (Sunday) - 7 (Saturday)
int  $yearDay @public  day of the year, 1 - 366
TIME.Dst  $dst @public  information about daylight saving time
 
NEW() @public  Create a new object using the current time and system time zone.
NEW(empty) @public  Create a new object. When empty is TRUE all fields are zero.
NEW(usec) @public  Create a new object using the time usec and using the system time zone.
$getUsec() int @public  Get the time stored in the object as micro seconds.
$ToString() string @public  Return the time in international format: YYYY/MM/DD hh:mm:ss.
$toStringDash() string @public  Return the time in international format, but using dashes: YYYY-MM-DD hh:mm:ss.
$toStringShort() string @public  Return the time in global English short format: Day, YYYY Mon DD hh:mm:ss.
$toStringFull() string @public  Return the time in global English format: Weekday, YYYY Month DD hh:mm:ss.
 
fromString(t) TIME.Values @public  Create a TIME.Values from a string like it is returned from $ToString() or $toStringDash().
 

members (alphabetically)

     

int $day @public

     

day of the month, 1 - 31

TIME.Dst $dst @public

     

information about daylight saving time

int $hour @public

     

hour, 0 - 23

int $min @public

     

minutes, 0 - 59

int $month @public

     

month, 1 - 12

int $sec @public

     

seconds, 0 - 59

int $usec @public

     

microseconds, 0 - 999'999

int $weekDay @public

     

day of the week, 1 (Sunday) - 7 (Saturday)

int $year @public

     

year, negative for BC

int $yearDay @public

     

day of the year, 1 - 366

PROC NEW() @public

     

Create a new object using the current time and system time zone.

PROC NEW(bool empty) @public

     

Create a new object. When empty is TRUE all fields are zero.

When empty is FALSE does the same as NEW().

PROC NEW(int usec) @public

     

Create a new object using the time usec and using the system time zone.

FUNC $ToString() string @public

     

Return the time in international format: YYYY/MM/DD hh:mm:ss.

FUNC $getUsec() int @public

     

Get the time stored in the object as micro seconds.

Returns -1 if the member values are wrong.

FUNC $toStringDash() string @public

     

Return the time in international format, but using dashes: YYYY-MM-DD hh:mm:ss.

This can be used in a file name, where slashes are not allowed.

FUNC $toStringFull() string @public

     

Return the time in global English format: Weekday, YYYY Month DD hh:mm:ss.

FUNC $toStringShort() string @public

     

Return the time in global English short format: Day, YYYY Mon DD hh:mm:ss.

shared (alphabetically)

     

FUNC fromString(string t) TIME.Values @public

     

Create a TIME.Values from a string like it is returned from $ToString() or $toStringDash().

The string must contain "YYYY.MM.DD.hh.mm.ss", where each dot can be one or more of slash, dash, space or colon. The seconds can be omitted, zero will be used then.

$weekDay, $yearDay and $dst will not be set.

If the format is wrong a E.BadValue exception is thrown.

license

      Copyright 2010 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0