Skip to content
Prev 36763 / 63424 Next

pretty.Date(): new "halfmonth" time step

On 20 May 2010 11:56, Daniel Murphy <chiefmurphy at gmail.com> wrote:
Dan, you are correct: the midpoint of a 30 day month is the 16th at
00:00. That instant is called the 16th according to print.POSIXt.

junstart <- as.POSIXct("2000-06-01 00:00", tz="GMT")
julstart <- as.POSIXct("2000-07-01 00:00", tz="GMT")
junstart + ((julstart - junstart) / 2)
#[1] "2000-06-16 GMT"

How embarassing...
So I think it would be better to use 16 rather than 15 for the
"halfmonth" time step.

Yes, months have variable lengths, but I think it is best to use a
consistent date (the 16th) than to calculate exact midpoints, just as
a normal monthly series has a consistent date (the 1st) and has
variable lengths.

Regards
-Felix
-- 
Felix Andrews / ???
Postdoctoral Fellow
Integrated Catchment Assessment and Management (iCAM) Centre
Fenner School of Environment and Society [Bldg 48a]
The Australian National University
Canberra ACT 0200 Australia
M: +61 410 400 963
T: + 61 2 6125 4670
E: felix.andrews at anu.edu.au
CRICOS Provider No. 00120C