Univeristy of Alabama in Huntsville

UAH LTG IDL Library

IDL Routines from Phillip Bitzer and UAH Lightning Group

summary     class     fields     routine details     file attributes

misc/time/

pmb_humantime2unix.pro

Misc, Time


Takes a "Human" time and converts it to Unix time. UTC time is usually given as a Month, day, year and the number of seconds past midnight. This routine takes that it converts to Unix time, which is (loosely) the number of seconds since midnight on Jan 1, 1970.

Examples

Let's say you have arrays holding "human" times, i.e., arrays that have times in months, days, years, and seconds past midnight:

months = [1, 1, 2, 12] days = [10, 11, 11, 11] years = [2010, 2010, 2010, 2010] secs = [0., 1000., 1000., 83000.]
Get the Unix time:
uTimes = PMB_HUMANTIME2UNIX(months, days, years, secs) print, uTimes

Author information

Author

Phillip M. Bitzer, University of Alabama in Huntsville, pm.bitzer "AT" uah.edu

History

Modification History:

Renamed and published using legacy code. 20140812 PMB

Other file information

Uses:

None

Routines

top pmb_humantime2unix

result = pmb_humantime2unix(month, day, year, sec_past_midnight)

This function will take a "human" time (month, day, year) and convert it to Unix time.

Return value

The time, in seconds, past the Unix Epoch (Jan 1, 1970 at 00:00). On error, NaN is returned.

Parameters

month in required type=numeric

The month of the date. Can be an array.

day in required type=numeric

The day of the date. Can be an array.

year in required type=numeric

The year of the date. Can be an array.

sec_past_midnight in required type=numeric

The number of seconds past midnight of the date(s) in question. Can be an array.

File attributes

Modification date: Tue Apr 4 15:07:29 2017
Lines: 22
Docformat: rst rst