Skip to content

Changing ts times to dates

2 messages · Chuse chuse, Gabor Grothendieck

#
You may need to modify this slightly depending on the specifics
of the fraction calculation but try this to get started:

x <- 2009.004
dt <- as.Date(paste(floor(x) + 0:1, 1, 1, sep = "-"))
dt[1] + as.numeric(diff(dt)) * (x %% 1) - 1  # 2009-01-01
On Thu, Jul 23, 2009 at 11:48 AM, Chuse chuse<chuse22 at gmail.com> wrote: