AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
date ([Locale lc ,] [TimeZone tz ,] String format [, double time]) yoix.util
date ([Locale lc ,] [TimeZone tz ,] double time)  
 
formats time or the current time according to the supplied format or the default format. When supplied, tz overrides the default timezone information and lc provides locale-specific information that overrides the default format, "EEE MMM dd HH:mm:ss zzz yyyy". time specifies seconds since zero hour GMT of January 1, 1970. The format specification is given by the following components:
G Text: era (e.g., AD)
y Number: year (e.g., 1999)
M Text or Number: month of year (e.g., November or 11)
d Number: day of month (e.g., 14)
h Number: hour as 12-hour clock (e.g., 10)
H Number: hour as 24-hour clock (e.g., 22)
m Number: minute of hour (e.g., 32)
s Number: second of minute (e.g., 23)
S Number: millisecond of second (e.g., 360)
E Text: day of week (e.g., Sunday)
D Number: day of year (e.g., 234)
F Number: occurrence of day of week in month (e.g., 1, which might mean the first Monday in September).
w Number: week of year (e.g., 49)
W Number: week of month (e.g., 2, which might mean that Sunday July 2 is in the second week of July where a week runs from Sunday to Saturday)
a Text: am/pm indicator (e.g., PM)
k Number: equivalent to the number given by format H plus one (e.g., 24)
K Number: equivalent to the number given by format h minus one (e.g., 0)
z Text: general time zone (e.g., EDT)
Z Text: RFC822 time zone (e.g., -0500)
' Delimiter: escape for text (e.g., 'The time now is: ')
'' Literal: single quote
The count of pattern letters determine the format as follows:
Text four or more pattern letters indicates full form, less than four indicates short or abbreviated form, if one exists.
Number the minimum number of digits to display. Shorter numbers are zero-padded to this amount, though the leading zero after space will be converted to a space. Year is a special case: if the count of 'y' is 2, the year will be truncated to 2 digits.
Text or Number three or over indicates text, otherwise a number is indicated.
Any characters in format that are not in the ranges of [a-z] and [A-Z] will be treated as single-quoted text.
 
 Example:   To get the current time in what is commonly known as the standard UNIX format, use:
yoix.stdio.puts(yoix.util.date());
namely:
Wed Jun 28  9:46:40 EDT 2000
 
 Return:   String
 
 See Also:   currentTimeMillis, nanoTime, parseDate, parseTimer, sleep, time, timerFormat

 

Yoix is a registered trademark of AT&T Inc.