Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | C Engelbrecht <cngelbrecht@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: RE: "Hours" in Stata |
Date | Wed, 30 Jun 2010 16:45:03 -0400 |
Thank you very much! On Wed, Jun 30, 2010 at 4:42 PM, Martin Weiss <martin.weiss1@gmx.de> wrote: > > <> > > *********** > di in r hours(clock("05nov2009 16:26:33", "DMYhms")-clock("04nov2009 > 17:01:54", "DMYhms")) > *********** > > > HTH > Martin > > > -----Original Message----- > From: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of C Engelbrecht > Sent: Mittwoch, 30. Juni 2010 22:34 > To: statalist@hsphsun2.harvard.edu > Subject: st: "Hours" in Stata > > Hi everyone, > > I can't seem to find an answer to this in the Stata manual (version > 11) so hopefully someone can help me with it. I have two time > variables in a dataset (%tc format), and I want to find out the > difference in them measured in hours. For example > > 04nov2009 17:01:54 > > and > > 05nov2009 16:26:33 > > > The hh() function only extracts the "hour" portion. It helps, but not > easy to use in this case (when more than one day is involved). I tried > subtracting them directly, but I'm not sure what's the "unit" for %tc > variables. > > Thanks! > * > * 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/ > > * > * 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/ > * * 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/