Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: add hours to date variable


From   Caleb Southworth <[email protected]>
To   [email protected]
Subject   st: add hours to date variable
Date   Sat, 28 Aug 2010 11:40:34 -0700 (PDT)

How can I add hours to a date variable? The hours are in decimal, such that 13:45 = 13.75, etc.

. sum date hour

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
        date |       735       18428    70.77298      18306      18550
        hour |       735    12.99728     4.90426          6         19

. desc date hour

              storage  display     value
variable name   type   format      label      variable label
-------------------------------------------------------------------------------------------------------------
date            float  %td
hour            byte   %9.0g


Caleb Southworth
Associate Professor
Univ. of Oregon Sociology
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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