NRAO Home > CASA > CASA Toolkit Reference Manual
quanta.splitdate - Function

1.5.1 split a date/time into a record


Description

splitdate splits a date/time quantity into a record with constituent fields like year, yearday, month etc. All fields will be integer (to enable use as index and easy personal formatting), with the exception of the s field which is a double float. See the example for the fields returned.

Arguments





Inputs

v

angle/time quantity

allowed:

any

Default:

variant

Returns
record

Example

 
 
"""  
#  
print "\t----\t splitdate Ex 1 \t----"  
print qa.splitdate(’today’)  
 
#{’mjd’: 54175.752367291658, ’week’: 11, ’usec’: 533999, ’hour’: 18,  
# ’min’: 3, ’yearday’: 75, ’msec’: 533, ’month’: 3, ’s’:  
# 24.533999226987362, ’sec’: 24, ’weekday’: 5, ’year’: 2007, ’monthday’:  
# 16} print qa.splitdate(’183.33333333deg’)  
#{’mjd’: 0.50925925925000004, ’week’: 46, ’usec’: 999999, ’hour’: 12,  
# ’min’: 13, ’yearday’: 321, ’msec’: 999, ’month’: 11, ’s’:  
# 19.999999200003487, ’sec’: 19, ’weekday’: 3, ’year’: 1858,  
# ’monthday’: 17}  
#  
"""  
 

__________________________________________________________________


More information about CASA may be found at the CASA web page

Copyright 2016 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