Skip to content
Back to formatted view

Raw Message

Message-ID: <CAAxdm-5A_oMC=sT=cLe7w9sTD_ChOtmzQZS+3JgYijyRd6+5Dw@mail.gmail.com>
Date: 2011-12-27T20:34:57Z
From: jim holtman
Subject: How to extract an interval of "hour:minute" type
In-Reply-To: <1325008943809-4237800.post@n4.nabble.com>

I think one of the suggestion was to use something like, assuming you
have the time in POSIXct

format(x$time, format = "%H:%M:%S") >= "20:10:00" & format(x$time,
format = "%H:%M:%S") <= "21:00:00"

This takes the 'date' out of the equation.  You can always write a
function to do this for you.



On Tue, Dec 27, 2011 at 1:02 PM, ikuzar <razuki at hotmail.fr> wrote:
> Jim Holtman > I'd like to compare "hour1:min1:sec1" with "hour2:min2:sec2".
> I know how to do to compare "year1-mon1-day1 hour1:min1:sec1" with
> "year2-mon2-day2 hour2:min2:sec2" by converting 'character' into POSIXlt
>
> but
>
> I'd like to konw if there is another way to do this comparison without
> converting my POSIXLT column into 'character' .
> If possible, I want to work with DateTime format and not with string so that
> I do not make new conversions
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/How-to-extract-an-interval-of-hour-minute-type-tp4237144p4237800.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.