Re: [R] as.Date() add a day to a date

2010-09-13 Thread David Winsemius
Try this: format(dt, '%Y-%m-%d'), if you want Date class: as.Date(format(dt, '%Y-%m-%d')) On Mon, Sep 13, 2010 at 2:24 PM, Andrew Yee wrote: Thanks David, now I wonder how you can have as.Date() render the date using local time rather than UTC. Andrew On Mon, Sep 13, 2010 at 12:08 PM

Re: [R] as.Date() add a day to a date

2010-09-13 Thread Andrew Yee
Henrique, thanks for your suggestion. For my applications, character would have been sufficient, so your suggestion of using format() works fine too. Perhaps I should submit a feature request for as.Date() to let you specify local time. Thanks, Andrew On Mon, Sep 13, 2010 at 2:06 PM, Henrique D

Re: [R] as.Date() add a day to a date

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 1:24 PM, Andrew Yee wrote: > Thanks David, now I wonder how you can have as.Date() render the > date using local time rather than UTC. > Since we are both in the EDT TZ at the moment, our times are UTC-4 (hours = 60*60 seconds) > dt <- as.POSIXct("2010-08-22 23:14:52")

Re: [R] as.Date() add a day to a date

2010-09-13 Thread Andrew Yee
Thanks David, now I wonder how you can have as.Date() render the date using local time rather than UTC. Andrew On Mon, Sep 13, 2010 at 12:08 PM, David Winsemius wrote: > > On Sep 13, 2010, at 11:56 AM, Andrew Yee wrote: > > I'm trying to understand why as.Date() is converting a the modified dat

Re: [R] as.Date() add a day to a date

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 11:56 AM, Andrew Yee wrote: I'm trying to understand why as.Date() is converting a the modified date of a file from August 22 to August 23. foo <- file.info(file.to.process) str(foo) 'data.frame': 1 obs. of 10 variables: $ size : num 5.37e+09 $ isdir : logi FALSE $

[R] as.Date() add a day to a date

2010-09-13 Thread Andrew Yee
I'm trying to understand why as.Date() is converting a the modified date of a file from August 22 to August 23. > foo <- file.info(file.to.process) > str(foo) 'data.frame': 1 obs. of 10 variables: $ size : num 5.37e+09 $ isdir : logi FALSE $ mode :Class 'octmode' int 436 $ mtime : POSIX