| To: | "Smeets, S (Sjoerd)" <S.Smeets@Interpolis.nl>, s-news@lists.biostat.wustl.edu |
|---|---|
| Subject: | Re: Converting a given double to a date |
| From: | Tony Plate <tplate@blackmesacapital.com> |
| Date: | Tue, 28 Sep 2004 10:11:03 -0600 |
| In-reply-to: | <57B39CA14745CD4BA605CBE29FD033E0029685E2@til-ex-04.ini.cor p> |
| References: | <57B39CA14745CD4BA605CBE29FD033E0029685E2@til-ex-04.ini.corp> |
|
Something like one of the following should do the trick. > x <- c(20010223, 20040530) > timeDate(as.character(x), in.format="%4Y%2m%2d") [1] 2001/02/23 2004/05/30 > timeCalendar(y=floor(x/10000), m=floor((x %% 10000) / 100), d=x %% 100) [1] 2001/02/23 2004/05/30 > A gotcha here is time zones. If you are using something other than: > options("time.zone") $time.zone: [1] "GMT" then you need to be careful with time zones -- the dates might not be getting the time of day that you want. -- Tony Plate At Tuesday 02:06 AM 9/28/2004, Smeets, S (Sjoerd) wrote: Hi, |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Reading contour maps with ArcView, Sam Kamau |
|---|---|
| Next by Date: | removing audit file, Leeds, Mark |
| Previous by Thread: | Converting a given double to a date, Smeets, S (Sjoerd) |
| Next by Thread: | Reading contour maps with ArcView, Sam Kamau |
| Indexes: | [Date] [Thread] [Top] [All Lists] |