Timestr, Estr, ve – Visara Master Console Center Scripting Guide User Manual
Page 201
Chapter 5 Script Commands
Scripting Guide
201
TIMESTR
Syntax:
TIMESTR( %EpochSeconds, $Format) ==> $Formatted
Description:
Formats epoch seconds into a date/time string.
Action:
The time value expressed as epoch seconds is formatted into a date/time
string as specified by the Format parameter.
Parameters:
%EpochSeconds. Numeric value. Date/time expressed as the number
of seconds past the epoch.
$Format. String expression. The template for the resultant date/time
string. Format consists of literal characters (such as a colon for a time
separator) and special formatting codes that determine the date and time
formats in the resultant string.
Each code specification begins with a percent sign “%” and ends with a
special code character. Non-code characters in the template are copied
“as is” into their relative position in the resultant string.
Refer to Date Related Codes for TIMESTR() following for the special code
characters and their definitions.
Returns:
String value. The time value formatted as a string.
Notes:
1. Refer also to the description of Date/Time on page 40.
2. In simple date and time format strings, the basic time codes are in
uppercase characters (%H:%M:%S) and the basic date codes are in
lowercase characters (%m/%d/%y).
3. In codes that pertain to the week number of the year, if the week
containing January 1 has four or more days in the new year, it is
considered week 1 of the new year. If not, it is week 53 of the
previous year, and the next week then becomes week 1.
4. The %S code permits values of up to 61, rather than up to 59, to
allow leap seconds that are sometimes added to years to keep clocks
in correspondence with the solar year. It poses no problem if this
feature is ignored.
5. The TIME () command returns the number of seconds since
midnight, so handing the result of a TIME() command to
TIMESTR() returns incorrect results.
Example:
$Msg := TIMESTR( SECONDS(), “Current date / time is %D %T”)
LOG( LOG_FLT, $Msg)
See Also:
DATE, SECONDS, TIME, WAITFOR