gdate (Aug2004) |
rjtools
|
gdate (Aug2004) |
gdate
gdate - parse and return the current date and time in various
formats
- utc = no
- Parse and return the current Universal date and time (UTC) rather than
the local time?
- (date) [string]
- Returns the current date, formatted as "DD Mon CCYY" (European format)
- (cdate) [string]
- Returns the current date, formatted as "Mon DD, CCYY" (US format)
- (ldate) [string]
- Returns the current date, formatted as "DD-Mon-CCYY" (European format)
- (day) [string]
- Returns the abbreviated day of the week, "Day"
- (month) [string]
- Returns the abbreviated name of the month, "Mon"
- (year) [string]
- Returns the year, "CCYY"
- (time) [string]
- Returns the current time, formatted as "hh:mm:ss"
- (tzone) [string]
- Returns the time zone for which 'time' is the current time, "ZZZ"
- (fdate) [string]
- Returns a FITS standard format date and time string, "CCYY-MM-DDThh:mm:ss"
Note that 'fdate' is always UTC, regardless of the value of parameter 'utc'.
- (tdate) [string]
- Returns a composite date and time string, formatted as
"Mon DD hh:mm:ss CCYY"
- (adate) [string]
- Returns a long composite date and time string, formatted as
"Day DD-Mon-CCYY hh:mm:ss"
- (ddate) [string]
- Returns a long composite date and time string, formatted as
"Day Mon DD hh:mm:ss TMZ CCYY"
- (sdate) [string]
- Returns a long composite date and time string, formatted as
"DD-Mon-CCYY hh:mm:ss TMZ"
- (ndate) [string]
- Returns a numeric date string in logical order, "CCYY/MM/DD"
- (udate) [string]
- Returns a short numeric date string in US order, "MM/DD/YY"
- (edate) [string]
- Returns a short numeric date string in European order, "DD/MM/YY"
- (nyear) [int]
- Returns the year number
- (nmon) [int]
- Returns the month number of the year
- (nday) [int]
- Returns the day number of the month
- (yday) [real]
- Returns the fractional day number of the year
- (jd) [real]
- Returns the approximate Julian day. Note that 'jd' is always UTC,
regardless of the value of parameter 'utc'.
Task to parse and return the current data and components thereof in
various formats. The current date is given either in UTC or in Local
Time, except 'fdate' and 'jd' which are always given as UTC. Parameter
'utc' is always restored to its default "no", so subsequent calls
that do not explicitly specify this parameter will return the local
time.
Write a timestamp to a log file:
rj> gdate(utc=yes); sysinfo()
rj> print ("# MY_TASK: "//sysinfo.sysmsg//" "//gdate.adate//" ",
gdate.tzone, >> "my_task.log")
which would result in a time stamp like:
# MY_TASK: IRAF2.12.2 raj@miduv Wed 31-Jul-2003 22:47:18 UTC
fscan, date, asttimes, sysinfo