s-news
[Top] [All Lists]

Re: Comparing today's date to a particular date

To: Dennis Fisher <fisher@plessthan.com>, "s-news@lists.biostat.wustl.edu" <s-news@lists.biostat.wustl.edu>
Subject: Re: Comparing today's date to a particular date
From: "Austin, Matt" <maustin@amgen.com>
Date: Tue, 15 Jan 2008 14:28:31 -0800
Accept-language: en-US
Acceptlanguage: en-US
In-reply-to: <7262F68C-A540-4547-B55B-69542141A26A@plessthan.com>
Thread-index: AchXoPGmUtC9IZSYTnyy0jIwrBqFcQAJERIg
Thread-topic: [S] Comparing today's date to a particular date
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



<Prev in Thread] Current Thread [Next in Thread>