Try setting timezone in as.Date:
> dt <- as.POSIXct("2013-09-30 22:40:24 EST")
> dt
[1] "2013-09-30 22:40:24 EDT"
> as.Date(dt)
[1] "2013-10-01"
> as.Date(dt, tz="EST")
[1] "2013-09-30"
EDIT: I was about to post what Roland commented on, and you can see that by looking at the attributes:
> attributes(dt)
$class
[1] "POSIXct" "POSIXt"
$tzone
[1] ""
So even though you think you're setting stuff to EST, you're not. The default is actually to local time (tz=""
) for as.POSIXct
:
A timezone specification to be used for the conversion, if one is required. System-specific (see time zones), but "" is the current timezone, and "GMT" is UTC (Universal Time, Coordinated).
But then for as.Date.POSIXct
, the default is UTC!