Message-ID: <B1A6D845-8F9F-4988-B922-0EC9754695C4@comcast.net>
Date: 2009-01-22T23:34:50Z
From: David Winsemius
Subject: time date stamp since, january 1st 1970
In-Reply-To: <4978F587.9010105@bellsouth.net>
Since the starting date is the same as that of the POSIXct class, it
should not be a big problem. Just divide by 1000.
> as.POSIXct(1232558018624/1000, origin="1970-01-01") # throws an
error if origin not set
[1] "2009-01-21 17:13:38 EST"
>
> as.POSIXct(0/1000, origin="1970-01-01")
[1] "1970-01-01 EST"
--
David Winsemius
On Jan 22, 2009, at 5:39 PM, zubin wrote:
> Hello, we are receiving some data, sample below - with a weird time/
> date
> stamp format, we need some help with R on converting this time date
> stamp to a useable field in R, date and time in a data-frame. The
> developer says its the number of milliseconds since midnight,
> January 1,
> 1970.
>
> sample: *1232558018624*
> ---------------------
>
>
> How do I interpret the time stamp? Is there a date, i need a date
> and time.
> site_id
> ,survey_id
> ,version_id,survey_start_ts,survey_question_id,start_ts,end_ts,answer
> 2,registration,1,1232558018625,z1,*1232558018624*,*1232558266179*,4
>
>
> Answer: The timestamp is a number representing the exact date and
> time.
> it is the number of milliseconds since midnight, January 1, 1970. Are
> you using it in the DB or R? I am not sure about R's conversion of
> numbers and dates. is there a way to add a number of seconds or
> milliseconds to a date in R?
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.