Converts years, months, days, hours, minutes and seconds to date and time values.
YMDHMS2DT(years, months, days, hours, minutes, seconds)
(date, time) = YMDHMS2DT(years, months, days, hours, minutes, seconds)
years |
- |
A scalar or series, the year values. |
months |
- |
A scalar or series, the month values. |
days |
- |
A scalar or series, the day values. |
hours |
- |
A scalar or series, the hours values. |
minutes |
- |
A scalar or series, the minutes values. |
seconds |
- |
A scalar or series, the seconds values. |
A datetime series where the data and time values are in two adjacent columns.
(date, time) = YMDHMS2DT(years, months, days, hours, minutes, seconds) returns the date and time in two separate variables.
W1: ymdhms2dt()
W1 contains the current datetime.
W1: ymdhms2dt(2028, 1, 2, 12, 0, 0)
W2: ymdhms2dt(2028, 3, 1, 12, 0, 0)
W3: dtduration(w2, w1)
W4: dtoffset(w1, w3)
Same as the first example, except the end and start year is 2028, a leap year. The duration is 5097600 seconds. The duration has increased by 86400 seconds from 5011200 seconds to 5097600 because of the leap year.
W2: ymdhms2dt(2030, 10, 31, 12, 0, 0)
W2 contains the datetime series:
10/31/2030 12:00:00
(d, t) = ymdhms2dt(2030, 10, 31, 12, 0, 0)
Same as above, except the date and time are returned to the variables d and t.
W3: ymdhms2dt(2030, 10, 32, 12, 0, 70)
W3 contains the datetime series:
11-01-2030 12:01:10
The day value wraps around and the seconds value wraps around.
W4: ymdhms2dt(2030..2034, 4, 1..5, 12, 10..14, 0)
W4 contains the datetime values:
4/01/2030 12:10:00
4/02/2031 12:11:00
4/03/2032 12:12:00
4/04/2033 12:13:00
4/05/2034 12:14:00
YMDHMS2DT converts years, months, days, hours, minutes and seconds to a datetime series.
A datetime series consists of 2 columns of values where the first column contains integer Julian dates starting at midnight and the second column contains time in seconds starting from midnight.
See DT2YMDHMS to convert a date time series to series of years, months, days, hours, minutes, seconds.
YMDHMS2DT is identical to DATETIME.