date-time comparison, aware vs naive

2012-12-10 Thread noydb
I want to compare a user entered date-and-time against the date-and-time of a pdf file. I posted on this (how to get a file's date-time) before, was advised to do it like: import datetime, os, stat mtime = os.lstat(filename)[stat.ST_MTIME] // the files modification time dt =

Re: date-time comparison, aware vs naive

2012-12-10 Thread John Gordon
In 21eb3e6f-9a82-47aa-93ff-8f4083d18...@googlegroups.com noydb jenn.du...@gmail.com writes: I want to compare a user entered date-and-time against the date-and-time of a pdf file. I posted on this (how to get a file's date-time) before, was advised to do it like: import datetime, os, stat

Re: date-time comparison, aware vs naive

2012-12-10 Thread noydb
Found this, and it solved my problem http://blogs.law.harvard.edu/rprasad/2011/09/21/python-string-to-a-datetime-object/ -- http://mail.python.org/mailman/listinfo/python-list

Re: date-time comparison, aware vs naive

2012-12-10 Thread Steven D'Aprano
On Mon, 10 Dec 2012 11:57:37 -0800, noydb wrote: I want to compare a user entered date-and-time against the date-and-time of a pdf file. I posted on this (how to get a file's date-time) before, was advised to do it like: import datetime, os, stat mtime = os.lstat(filename)[stat.ST_MTIME]

Re: date-time comparison, aware vs naive

2012-12-10 Thread noydb
On Monday, December 10, 2012 3:52:55 PM UTC-5, Steven D'Aprano wrote: On Mon, 10 Dec 2012 11:57:37 -0800, noydb wrote: I want to compare a user entered date-and-time against the date-and-time of a pdf file. I posted on this (how to get a file's date-time) before, was advised to

Re: date-time comparison, aware vs naive

2012-12-10 Thread Dave Angel
On 12/10/2012 03:52 PM, Steven D'Aprano wrote: On Mon, 10 Dec 2012 11:57:37 -0800, noydb wrote: I want to compare a user entered date-and-time against the date-and-time of a pdf file. I posted on this (how to get a file's date-time) before, was advised to do it like: import datetime, os,

Re: date-time comparison, aware vs naive

2012-12-10 Thread noydb
http://docs.python.org/2/library/datetime An object of type *time* or *datetime* may be naive or *aware aware refers to time-zone and daylight savings time, such political ephemerals. Two times can only be changed if one knows they're both in the same one, or if one