Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'output,': 0.09; 'looked': 0.10; 'appreciated!': 0.16; 'comparison.': 0.16; 'disk.': 0.16; 'doesnt': 0.16; "file's": 0.16; 'from:addr:awilliam': 0.16; 'from:addr:whitemice.org': 0.16; 'from:name:adam tauno williams': 0.16; 'offset,': 0.16; 'received:72.14.190': 0.16; 'received:72.14.190.87': 0.16; 'received:mail.wmmi.net': 0.16; 'received:wmmi.net': 0.16; 'reply-to:addr:awilliam': 0.16; 'reply- to:addr:whitemice.org': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'module,': 0.17; 'received:72.14': 0.20; 'all,': 0.21; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'guess': 0.27; 'first.': 0.27; 'newer': 0.27; 'correct': 0.28; '-0700,': 0.29; 'things,': 0.29; 'url:2012': 0.30; 'file': 0.32; 'to:addr:python-list': 0.33; 'entered': 0.34; 'list': 0.35; 'add': 0.36; 'compare': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'some': 0.38; 'received:10': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'help': 0.40; 'more': 0.63; 'url:10': 0.65; 'header:Reply-To:1': 0.68; 'reply-to:no real name:2**0': 0.72 Subject: Re: date and time comparison how to From: Adam Tauno Williams To: python-list@python.org Date: Fri, 02 Nov 2012 07:22:50 -0400 In-Reply-To: <50e576ea-2ebe-4340-954e-6c23b5885680@googlegroups.com> References: <50e576ea-2ebe-4340-954e-6c23b5885680@googlegroups.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: awilliam@whitemice.org List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351855379 news.xs4all.nl 6987 [2001:888:2000:d::a6]:49412 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32624 On Mon, 2012-10-29 at 16:13 -0700, noydb wrote: > All, > I need help with a date and time comparison. > Say a user enters a date-n-time and a file on disk. I want to compare > the date and time of the file to the entered date-n-time; if the file > is newer than the entered date-n-time, add the file to a list to > process. > How best to do? I have looked at the datetime module, tried a few > things, no luck. > Is os.stat a part of it? Tried, not sure of the output, the > st_mtime/st_ctime doesnt jive with the file's correct date and > time. ?? > Any help would be appreciated! Date and time is much more complicated then people guess at first. What do you mean by "st_mtime/st_ctime doesnt jive with the file's correct date"? Is it off my some offset, or does it completely not match?