time.eh

Time and date. More...

use "time.eh"

Functions

def datestr(time: Long): String;
def day(time: Long): Int;
def dow(time: Long): Int;
def hour(time: Long): Int;
def millis(time: Long): Int;
def minute(time: Long): Int;
def month(time: Long): Int;
def second(time: Long): Int;
def systime(): Long;
def timeof(year: Int, month: Int, day: Int, hour: Int, min: Int, sec: Int, millis: Int): Long;
def year(time: Long): Int;

Description

Time is represented by Long value of milliseconds passed since "the epoch" (January 1, 1970, 00:00:00 GMT).

Function details

def systime(): Long;
Returns current system time.

def datestr(time: Long): String;
Converts time to a string. String has the form "dow mon dd hh:mm:ss zzz yyyy", where:

def year(time: Long): Int;
Returns year represented by this time.

def month(time: Long): Int;
Returns month represented by this time as value in range from 1 to 12.

def day(time: Long): Int;
Returns day of month represented by this time.

def dow(time: Long): Int;
Returns day of week represented by this time as value in range from 1 to 7. Value 1 corresponds to Sunday.

def hour(time: Long): Int;
Returns hour of day represented by this time as value in range from 0 to 23.

def minute(time: Long): Int;
Returns minute within hour represented by this time as value in range from 0 to 59.

def second(time: Long): Int;
Returns second within minute represented by this time as value in range from 0 to 59.

def millis(time: Long): Int;
Returns millisecond within second represented by this time as value in range from 0 to 999.

def timeof(year: Int, month: Int, day: Int, hour: Int, min: Int, sec: Int, millis: Int): Long;
Returns time constant corresponding to given date.