Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.048 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'case.': 0.05; 'clock,': 0.09; 'cc:addr:python-list': 0.10; "computer's": 0.16; 'subject: \n ': 0.16; 'subject:entire': 0.16; 'utc': 0.16; 'wrote:': 0.17; 'subject:Issue': 0.17; 'skip:p 30': 0.20; 'import': 0.21; 'cc:2**0': 0.23; 'this:': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; '----------': 0.26; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'fine': 0.28; '>>>>': 0.29; 'date:': 0.29; 'reset': 0.29; 'fri,': 0.30; 'function': 0.30; 'not.': 0.32; 'suggestion': 0.32; 'received:74.125.82': 0.33; 'problem': 0.33; 'hi,': 0.33; 'changed': 0.34; 'received:google.com': 0.34; 'sequence': 0.35; 'pm,': 0.35; 'really': 0.36; 'subject:': 0.36; 'received:74.125': 0.36; 'compare': 0.36; 'email addr:python.org': 0.36; 'subject:with': 0.36; 'should': 0.36; 'skip:p 20': 0.36; 'possible': 0.37; 'subject:: ': 0.38; 'from:': 0.38; 'forwarded': 0.38; 'help': 0.40; 'think': 0.40; 'your': 0.60; 'email name :python-list': 0.62; 'reply': 0.66; 'serial': 0.66; 'subject:day': 0.66; 'day': 0.73; '+1100': 0.84; '2013': 0.84; 'norway': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=c81CTFB6Wct63fGntzHTPuKsuT9+alh7ZtliOUUFuTs=; b=v03U2yypdvst3iNe8kD6bGPyEUldSLHBh/Ayeqn5qcn0n4NcszRF9gcyWjaSRiT3hP T2b/6uTi4Hz9iMC3VvnbwCegAQ5c/RZrbjdgX3NvRBfSxcrUDUsEZ0ip/cElfmXu2YG3 bScfof6xPFxJToV0cnnbJEyDI1Od3bmY/ly1fZA1KMgLIUq7slOr7zPeF3OLCxhI/2tm eJajHyOm82MkZmtTraiFvjXHQqTt+r35YTghFyEfYICdqdyc83I5puIJ5tdjUTCJ9dVq iHgexGnxMTNK63lWiomeBOSo7SEE6UIXs/lTj8hhgBHiiIB7ThMu4SZb7VNeApQ9gbQR r+eA== MIME-Version: 1.0 X-Received: by 10.194.239.202 with SMTP id vu10mr16226643wjc.49.1362130957140; Fri, 01 Mar 2013 01:42:37 -0800 (PST) In-Reply-To: References: Date: Fri, 1 Mar 2013 10:42:36 +0100 Subject: Re: Issue with continous incrementing of unbroken sequence for a entire working day From: Morten Engvoldsen To: Chris Angelico Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362131401 news.xs4all.nl 6924 [2001:888:2000:d::a6]:53834 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40241 Hi, Thanks.. :) so simply i can use time.strftime("%d%-m-%y %H:%M") , and then i can compare the date.... ---------- Forwarded message ---------- From: Chris Angelico To: python-list@python.org Cc: Date: Fri, 1 Mar 2013 18:59:16 +1100 Subject: Re: Issue with continous incrementing of unbroken sequence for a entire working day On Fri, Mar 1, 2013 at 6:50 PM, Morten Engvoldsen wrote: > Hi, > No i don't want user to blame when date is changed and serial number > reset when it should not. Do you think the following function will > help for this: > > import datetime as dt >>>> import pytz >>>> utc = pytz.timezone("UTC") >>>> norway = pytz.timezone("Europe/Norway") >>>> a = dt.datetime(2008, 7, 6, 5, 4, 3, tzinfo=utc) >>>> b = a.astimezone(norway) > > Your suggestion is really appreciated.. (posting reply on-list, hope that's okay!) That would be fine for the normal case. It's just possible that the user will change the computer's clock, which would result in the serial changing oddly. If that's not a problem to you, the job's done! ChrisA