[R-SIG-Finance] question about time-stamp comparison?

Brian G. Peterson brian at braverock.com
Fri Jan 20 17:02:00 CET 2012


On Fri, 2012-01-20 at 09:49 -0600, Michael wrote:
> Good morning all!
> 
> Just wanted to confirm - how do I compare two date-time stamps in the
> following format?

> > "2011-09-20 12:01:33.386168"< "2011-09-20 12:01:33.386169"
> 
> [1] TRUE

You don't tell us what class those timestamps are.

Assuming you're using xts objects for your time series (which you should
be), then the index is POSIXct, and < > = , etc are defined for the
POSIXct class.

It won't care about the string format.

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list