Message-ID: <20090128105023.1becb7b3@mimi>
Date: 2009-01-28T09:50:23Z
From: Yohan Chalabi
Subject: Can I create a timeDate object using only year and week of the year values?
In-Reply-To: <4f1819890901270836q17e92ff7le43b4bf150e9db1f@mail.gmail.com>
>>>> "TB" == Ted Byers <r.ted.byers at gmail.com>
>>>> on Tue, 27 Jan 2009 11:36:22 -0500
TB> What I have found so far includes:
TB>
TB> library(Rmetrics)
TB> time1 = timeDate(charvec = Sys.Date(), format = %Y-%m-%d,
TB> zone = ,
TB> FinCenter = )
TB> time2 = timeDate(2004-08-30, format = %Y-%m-%d, zone = ,
TB> FinCenter =
TB> )
TB> difftimeDate(time1,time2,units = weeks)
TB>
TB>
TB> Does timeDate use the format strings used by the UNIX date(1)
TB> command? If
TB> so, then can I safely assume timeDate will accept %Y-%U-%w,
TB> and behave
TB> correctly?
Hi Ted,
timeDate uses internally the function 'strptime' to convert
the input charvec to the ISO time format.
As pointed out in the the manual page of 'strptime', the formats are
system-specific but should follow the ISO C / POSIX standard. Have a
look at ?strptime.
Hope this help,
Yohan
--
PhD student
Swiss Federal Institute of Technology
Zurich
www.ethz.ch