Description
time converts a time quantity to a formatted string. The formatting
information is a precision (0 is default, 6 includes hh.mm.ss) and a
string array of codes (no-case, minimax match):
Codes include:
- clean
- delete leading/trailing superfluous separators
- no_d
- do not show hours part
- no_dm
- do not show hours and minutes part
- ymd
- include a date as yyyy/mm/dd (date is by default not shown)
- dmy
- include a date as ddMMMyyyy (date is by default not shown)
- mjd
- include a date as Modified Julian Day (date is by default not shown)
- fits
- include a date and show time in FITS format: le from OS
- angle
- show in angle (dd.mm.ss.ttt) rather than time format
- day
- prefix day-of-week to output
- local
- show local time rather than UTC (add timezone offset)
- no_time
- suppress printing of time part
If a multi-dimensional value is given for the value
v, the returned value
is a string vector of a length equal to last dimension. Each string has a
number of fields equal to the number of elements in all earlier
dimensions. If the
showform is
T, each vector element is surrounded
by a pair of square brackets if there is more than one entry, and fields are
separated by a ','.
Example
- tu := dq.quantity('today') # a time
- tu
[value=50450.2243, unit=d]
- dq.time(tu) # default format
05:23:01.000
- dq.time(tu,form="dmy") # show date
02-Jan-1997/05:23:01.000
- dq.time(tu,form="ymd day") # and day
Thu-1997/01/02/05:23:01.000
- dq.time(tu,form="fits") # FITS format
1997-01-02T05:23:01.000
- dq.time(tu,form="fits local") # local FITS format
1997-01-02T15:23:01.000+10:00
- dq.time(tu,form="ymd local") # local time
1997/01/02/15:23:01.000
Next: quanta.add - Function
Up: quanta - Tool
Previous: quanta.angle - Function
 
Contents
 
Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc.,
Washington, D.C.
Return to AIPS++ Home Page
2006-08-01