Does the following do what you want?
timeDate(date(), in.format="%w %m %d %H:%M:%S %Z %Y") > timeDate("2009-01-01",
in.format="%Y-%M-%d")
--Matt
Matt Austin
Director, Biostatistics
Amgen, Inc
________________________________
From: s-news-owner@lists.biostat.wustl.edu
[mailto:s-news-owner@lists.biostat.wustl.edu] On Behalf Of Dennis Fisher
Sent: Tuesday, January 15, 2008 10:03 AM
To: s-news@lists.biostat.wustl.edu
Subject: [S] Comparing today's date to a particular date
Colleagues,
I would like to compare today's date to a particular date, e.g., next January
1. In R, you could do something like:
as.numeric(Sys.Date()) < as.numeric(as.Date("2009-01-01"))
However, fewer time-related commands are available in S-Plus. Does anyone have
a quick fix to this?
Dennis
Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-415-564-2220
www.PLessThan.com
|