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]

Re: st: FW: working with date & time variables when time refers to 01jan1960


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: FW: working with date & time variables when time refers to 01jan1960
Date   Fri, 4 May 2012 07:11:55 +0100

This is prominently documented. You are expected to read the help!

Look at -help dates and times- and specifically the -clock()- function first.

Nick

On Fri, May 4, 2012 at 6:26 AM, Mendoza Aldana, Dr Jorge Antonio
(WPRO) <MendozaAldanaj@wpro.who.int> wrote:

> I've received a dataset containing date (date1 and date2) and time (time1 and time2) variables; time1 is the time on date1 when an event happened; the same for time2 and date2.
> I need to compute the difference in minutes between date1_time1 to date2_time2. But, the format of time1 and time2 is e.g. "01Jan1960 10:20:00".
>
> the data looks like below,
>
> date1       time1               date2      time2
> 05may2010   01jan1960 10:00:00  05may2010  01jan1960 10:40:00
> 10may2011   01jan1960 23:50:00  11may2011  01jan1960 00:30:00
>
> So, I need to find a way to calculate the difference in minutes, which in the examples above is 40 minutes.
> I am using Stata 11 on Windows XP.
> I would appreciate ideas or links to references on how to solve this.

*
*   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