Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

RE: st: Coverting variable to date and time

From   Neophytos Stylianou <>
To   "" <>
Subject   RE: st: Coverting variable to date and time
Date   Fri, 24 May 2013 10:45:40 +0000

Nick I have some more questions about time and date.

I have read through the help file but it is not clear to me what is the difference of %tc and %tC

I have converted my data to YMDhms and it works

Just for my practise I have also split the variable and converted the two splits into date and time variable form strings

I have entries for the same date but for morning as well as afternoon.

How will I separate them in AM and PM?

Is it something like:
Gen time2= AM if time1 >=00:00:00 & time1<=12:00:00
Replace time2=PM if time1>12:00:00 &time1<00:00:00


-----Original Message-----
From: [] On Behalf Of Nick Cox
Sent: 24 May 2013 11:00
Subject: Re: st: Coverting variable to date and time

That is no problem: it is in many ways the easiest and best way to import dates and/or  times into Stata.

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index