Bookmark and Share

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

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

st: RE: statalist-digest V4 #4311

From   Mark McCann <>
To   "" <>
Subject   st: RE: statalist-digest V4 #4311
Date   Fri, 21 Oct 2011 14:31:11 +0100

Hello all,

                I'm at a loss as to what's happening here. I have checked the help files and statalist, but I just can't make sense of this. My time variable appears to be reading seconds incorrectly, this happened before I added a dummy ":00" seconds onto the string variable, and after (as below). Any ideas on what is happening? I'm using Stata 11 on Windows

gen space=" "
gen seconds=":00"
egen time1=concat(date space time seconds)
gen time2=clock(time1,"DMYhms")
format time2 %tc

Here are the results for the first observation, I've fixed these to stop formatting problems

Date 01/05/2011   
Time 00:01       
Seconds :00   
Time1 [The used variable] 01/05/2011 00:01:00   

Time2 [The final variable] 01may2011 00:00:28 

Similar errors occur throughout, in some cases rounding up or down would give the wrong result so I can't use a quick fix and ignore the problem!

Any help much appreciated.

                Kind regards,

Research Statistician
Improving Children's Lives 
Institute of Child Care Research
Queen's University Belfast
6 College Park
Belfast BT7 1LP

Tel: +44(0)28 9097 3163

*   For searches and help try:

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