Stata 15 help for clock

[FN] Date and time functions

Function

Clock(s1,s2[,Y]) Description: the e_tC datetime (ms. with leap seconds since 01jan1960 00:00:00.000) corresponding to s1 based on s2 and Y

Function Clock() works the same as function clock() except that Clock() returns a leap second-adjusted %tC value rather than an unadjusted %tc value. Use Clock() only if original time values have been adjusted for leap seconds. Domain s1: strings Domain s2: strings Domain Y: integers 1000 to 9998 (but probably 2001 to 2099) Range: datetimes 01jan0100 00:00:00.000 to 31dec9999 23:59:59.999 (integers -58,695,840,000,000 to >253,717,919,999,999) and missing

clock(s1,s2[,Y]) Description: the e_tc datetime (ms. since 01jan1960 00:00:00.000) corresponding to s1 based on s2 and Y

s1 contains the date, time, or both, recorded as a string, in virtually any format. Months can be spelled out, abbreviated (to three characters), or indicated as numbers; years can include or exclude the century; blanks and punctuation are allowed.

s2 is any permutation of M, D, [##]Y, h, m, and s, with their order defining the order that month, day, year, hour, minute, and second occur (and whether they occur) in s1. ##, if specified, indicates the default century for two-digit years in s1. For instance, s2 = "MD19Y hm" would translate s1 = "11/15/91 21:14" as 15nov1991 21:14. The space in "MD19Y hm" was not significant and the string would have translated just as well with "MD19Yhm".

Y provides an alternate way of handling two-digit years. Y specifies the largest year that is to be returned when a two-digit year is encountered; see date(). If neither ## nor Y is specified, clock() returns missing when it encounters a two-digit year. Domain s1: strings Domain s2: strings Domain Y: integers 1000 to 9998 (but probably 2001 to 2099) Range: datetimes 01jan0100 00:00:00.000 to 31dec9999 23:59:59.999 (integers -58,695,840,000,000 to 253,717,919,999,999) and missing


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index