[Tutor] date range

Alan Gauld alan.gauld at btinternet.com
Wed Feb 3 04:30:09 EST 2016

On 02/02/16 21:54, Chelsea G wrote:

> date row. I am trying to see if I can read in a csv file and search for a
> certain date range like 1/2/2016 to 1/5/2016. 

Ben has given you some good advice on how to tackle the overall issue.

To deal with the dates you will probably want to use the time and/or
datetime modules. They can convert formatted strings into datetime
objects which can be compared to get a timedelta object representing the
difference in days, seconds and microseconds (although the last is not
very reliable and depends on OS acuracy)

Alan G
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:

More information about the Tutor mailing list