clock()
Purpose
Get the current date and time
Description
Returns a structure containing the current system date and time
Syntax
c = clock( )
Arguments
c.year current year
c.month current month of the year (1-12)
c.day current day of the month (1-31)
c.hour current hour (1-24)
c.minute current minute (0-59)
c.second current second (0-59)
Example
hour = "00"
minute = "00"
second = "00"
size = 100.0
textSize( size )
loop
clear()
c = clock()
if c.hour < 10 then
hour = "0" + str( c.hour )
else
hour = str( c.hour )
endIf
if c.minute < 10 then
minute = "0" + str( c.minute )
else
minute = str( c.minute )
endIf
if c.second < 10 then
second = "0" + str( c.second )
else
second = str( c.second )
endIf
now = hour + ":" + minute + ":" + second
tw = textWidth( now )
drawText( ( gwidth() - tw ) / 2, ( gheight() - size ) / 2, size, white, now )
update()
repeat
Associated Commands