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: Epoch time (aka Unix time) in Stata

From   Nick Cox <>
Subject   Re: st: Epoch time (aka Unix time) in Stata
Date   Wed, 3 Oct 2012 08:58:31 +0100

Stata's date and time functions were revised in Stata 10. One
consequence is that "mdy" only works as an argument to -date()- under
version control:

. di date("1/1/1970","mdy")

. version 9: di date("1/1/1970","mdy")

If your data are in seconds, see for one solution

(Stata users can't write Stata functions, only Stata commands and Mata


On Wed, Oct 3, 2012 at 5:01 AM, Michael Costello
<> wrote:

> I have quite a bit of date information that is stored in epoch time
> (aka Unix time).  I need to convert it to something readable.  I found
> this post (
>  in the archives, but the code doesn't seem to run (perhaps because of
> differences in Stata since 2002).  Does anyone know an easy method, or
> has anyone written a function to do these conversions?
*   For searches and help try:

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