Follow up to mg106646 - Selecting a range of dates?
- To: mathgroup at smc.vnet.net
- Subject: [mg107197] Follow up to mg106646 - Selecting a range of dates?
- From: Jason Ledbetter <jasonbrent at gmail.com>
- Date: Fri, 5 Feb 2010 03:22:52 -0500 (EST)
Folk, Given a list of date strings with each member in the list being in the format of "Thu Nov 19 12:09:23 GMT 2009", what is the best method of selecting matches between a date range? e.g., all data between November 1 2009 to November 8th 2009... I need to make sure this crosses year boundaries and such. My initial though is to convert the datestring into seconds since epoch and do a basic numerical comparison between two ranges. I've tried: Cases[zz, _?(AbsoluteTime[{"12/01/2009", {"Month", "Day", "Year"}}] >= AbsoluteTime[#[[1]]] <= AbsoluteTime[{"12/02/2009", {"Month", "Day", "Year"}}]) &] where 'zz' is: {{"Tue Dec 01 00:03:57 GMT 2009", 7370}, {"Tue Dec 01 04:57:23 GMT 2009", 16179}, {"Mon Dec 07 20:50:04 GMT 2009", 8546}, {"Wed Dec 09 00:29:57 GMT 2009", 9017}} Thoughts? -jbl