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]

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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index