9.11 Time object

Description

You can query the current date/time of the computer with the Time object.

List of methods/properties

NameTypeShort description
WeekdayPropertyThe current weekday
DayPropertyThe current day of the month
MonthPropertyThe current month
YearPropertyThe current year
HourPropertyThe current hour
MinutePropertyThe current minute
SecondPropertyThe current second
MillisecondPropertyThe current millisecond
TickPropertyA continuous counter in milliseconds

Weekday

Description

This property returns the current weekday. Sunday is the first day of the week (0 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday).

Syntax

1
Time.Weekday

Data type

Word

Type

Property, read-only

Example

1
2
$
v[1] = Time.Weekday
At the end v[1] whould be the current weekday (e. g. on a tuesday v[1] whould be 2).

Day

Description

This property returns the current day of the month.

Syntax

1
Time.Day

Data type

Word

Type

Property, read-only

Example

1
2
$
v[1] = Time.Day
At the end v[1] whould be the current day of the month (e. g. at the 08. January 1987 this whould be 8).

Month

Description

This property returns the current month. (1 = January, 2 = February, 3 = March, 4 = April, 5 = May, 6 = June, 7 = July, 8 = August, 9 = September, 10 = October, 11 = November, 12 = December)

Syntax

1
Time.Month

Data type

Word

Type

Property, read-only

Example

1
2
$
v[1] = Time.Month
At the end v[1] whould be the current month (e. g. at the 08. January 1987 this whould be 1).

Year

Description

This property returns the current year.

Syntax

1
Time.Year

Data type

Word

Type

Property, read-only

Example

1
2
$
v[1] = Time.Year
At the end v[1] whould be the current year (e. g. at the 08. January 1987 this whould be 1987).

Hour

Description

This property returns the current hour.

Syntax

1
Time.Hour

Data type

Word

Type

Property, read-only

Example

1
2
$
v[1] = Time.Hour
At the end v[1] whould be the current hour (e. g. at 12:30 this whould be 12).

Minute

Description

This property returns the current minute.

Syntax

1
Time.Minute

Data type

Word

Type

Property, read-only

Example

1
2
$
v[1] = Time.Minute
At the end v[1] whould be the current minute (e. g. at 12:30 this whould be 30).

Second

Description

This property returns the current second.

Syntax

1
Time.Second

Data type

Word

Type

Property, read-only

Example

1
2
$
v[1] = Time.Second
At the end v[1] whould be the current second.

Millisecond

Description

This property returns the current millisecond.

Syntax

1
Time.Millisecond

Data type

Word

Type

Property, read-only

Example

1
2
$
v[1] = Time.Millisecond
At the end v[1] whould be the current millisecond.

Tick

Description

This counter counts every millisecond up by one. The value of this property is equivalent to the Windows function GetTickCount. This property can be used to measure time differences. You simply save the value before and after an action. The difference is the required time for that action in milliseconds.

Syntax

1
Time.Tick

Data type

Dword

Type

Property, read-only

Example

1
2
$
v[1] = Time.Tick
At the end v[1] whould be the current tick of the computer.