SystemTime

Description:

baSystemTime returns the current time/date.

Platforms:

Windows and Macintosh

Usage:

Result = baSystemTime( Format )

Arguments:

String.
Format is the time/date format to return.

Returns:

String.
Returns the requested time/date.

Examples:

Director:
theTime = baSystemTime( "date" )

Authorware:
theTime := baSystemTime( "Today is %A" ) -- returns the day eg "Today is Tuesday"
 

Notes:

There are two predefined formats - "time" and "date"

"time" will return the current time in 24 hour format with leading zeros - hours, minutes and seconds eg "230412". It will always be 6 characters long.

"date" will return the date in year, month, day eg "19980321". It will always be 8 characters long,

Other formatting is available. Any of these constants will be replaced by the appropriate time/date - any other characters will be returned as is.
 

%a 

Abbreviated weekday name

%A 

Full weekday name

%b 

Abbreviated month name

%B 

Full month name

%d 

Day of month as decimal number (1 - 31)

%0d 

Day of month with leading 0

%H 

Hour in 24-hour format (0 - 23)

%0H 

Hour in 24-hour format with leading 0

%j 

Day of year as decimal number (1 - 366)

%0j 

Day of year as decimal number with leading 0

%m 

Month as decimal number (1 - 12)

%0m 

Month as decimal number with leading 0

%M 

Minute as decimal number (0 - 59)

%0M 

Minute as decimal number with leading 0

%S 

Second as decimal number (0 - 59)

%0S 

Second as decimal number with leading 0

%w 

Weekday as decimal number (0 - 6; Sunday is 0)

%y 

Year without century, as decimal number (00 - 99)

%Y 

Year with century, as decimal number

Examples:

"%d %B, %Y" - "2 June, 1998"

"It is %M past %H on %A" - "It is 23 past 10 on Tuesday"

"The time is %H:%0M:%0S" - "The time is 14:25:04"

 

See also:

baSetSystemTime