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

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 date

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 a

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_MT

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 John Gordon
In <21eb3e6f-9a82-47aa-93ff-8f4083d18...@googlegroups.com> noydb 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 > mtime = os.ls

Re: Date & time in a Zip File

2005-07-13 Thread Scott David Daniels
Tim Williams (gmail) wrote: > Using zipfile.Zipfile > > How can I add a file to a zip file and keep its date and time correct? > Currently the date/time change to the time the file was added to the > zip.Zipinfo doesn't have a write method! > > Solutions other than zipfile are welcome, with

Re: Date & time in a Zip File

2005-07-13 Thread Larry Bates
When I add files to my .ZIP files using python zipfile module the date/time that is stored in mine is the one that comes from the file's attributes. I'm not sure I understand why you think yours are not. -Larry Bates Tim Williams (gmail) wrote: > Using zipfile.Zipfile > > How can I add a file

Re: date/time

2005-01-05 Thread David M. Cooke
Thomas Guettler <[EMAIL PROTECTED]> writes: > Am Wed, 05 Jan 2005 15:08:37 +0100 schrieb Nader Emami: > >> L.S., >> >> Could somebody help me how I can get the next format of date >> from the time module? > > I don't understand your question. Do you want to have the next day? > > 20041231 --> 200

Re: date/time

2005-01-05 Thread Lee Harr
On 2005-01-05, Nader Emami <[EMAIL PROTECTED]> wrote: > L.S., > > Could somebody help me how I can get the next format of date > from the time module? > > example: I have to have this time 20050105. It is the next > attributes of format %Y%m%d. > I would use the datetime module: >>> import date

Re: date/time

2005-01-05 Thread Thomas Guettler
Am Wed, 05 Jan 2005 15:08:37 +0100 schrieb Nader Emami: > L.S., > > Could somebody help me how I can get the next format of date > from the time module? I don't understand your question. Do you want to have the next day? 20041231 --> 20050101 ? You can do it like this: - parse the string with

Re: date/time

2005-01-05 Thread Binu K S
>>> import time >>> time.strftime('%Y%m%d',time.localtime()) '20050105' On Wed, 05 Jan 2005 15:08:37 +0100, Nader Emami <[EMAIL PROTECTED]> wrote: > L.S., > > Could somebody help me how I can get the next format of date > from the time module? > > example: I have to have this time 20050105. It i