1.4.1 show a time (or date) as a formatted string
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:
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 ’,’.
Arguments
| Inputs |
| ||
| v |
| time quantity value to output
| |
| allowed: | variant |
|
| Default: |
|
|
| prec |
| number of digits shown
| |
| allowed: | int |
|
| Default: | 0 |
|
| form |
| formatting information in coded string array
| |
| allowed: | stringArray |
|
| Default: |
|
|
| showform |
| show square brackets and separating ,
| |
| allowed: | bool |
|
| Default: | false |
|
Example
"""
# print "\t----\t time Ex 1 \t----" tu = qa.quantity(’today’) # a time print tu #{’value’: 54175.708981504627, ’unit’: ’d’} print qa.time(tu) # default format #17:00:56 print qa.time(tu,form="dmy") # show date #16-Mar-2007/17:00:56 print qa.time(tu,form=["ymd","day"]) # and day #Fri-2007/03/16/17:00:56 print qa.time(tu,form="fits") # FITS format #2007-03-16T17:00:56 print qa.time(tu,form=["fits","local"]) # local FITS format #2007-03-16T10:00:56-07:00 print qa.time(tu,form=["ymd","local"]) # local time #2007/03/16/10:00:56 # """ |
Please send any comments or questions about CASA or AIPS++ to aips2-requests@nrao.edu
Copyright © 2008 Associated Universities Inc., Washington, D.C.
This code is available under the terms of the GNU General Public Lincense
Home |
Contact Us |
Directories |
Site Map |
Help |
Privacy Policy |
Search
Updated daily during alpha development.