Path: csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(at': 0.03; 'that?': 0.05; 'nicely': 0.07; 'parser': 0.07; 'api': 0.09; 'accepts': 0.09; 'command.': 0.09; 'parsed': 0.09; 'cc:addr:python-list': 0.10; '*and': 0.16; '-tkc': 0.16; 'already,': 0.16; 'formats.': 0.16; 'former,': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'latter,': 0.16; 'merely': 0.16; 'message-id:@tim.thechases.com': 0.16; 'received:70.251': 0.16; 'received:dsl.rcsntx.swbell.net': 0.16; 'received:rcsntx.swbell.net': 0.16; 'received:swbell.net': 0.16; 'roy': 0.16; 'url:at': 0.16; 'wrote:': 0.17; 'written': 0.20; 'doc': 0.22; 'cc:2**0': 0.23; 'specified': 0.23; 'statement': 0.23; "i've": 0.23; 'seems': 0.23; 'cc:no real name:2**0': 0.24; 'allows': 0.25; 'least': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'format,': 0.27; 'i.e.': 0.27; 'far,': 0.29; 'code': 0.31; 'anybody': 0.32; 'formats': 0.35; 'subject:?': 0.35; 'but': 0.36; 'subject:" ': 0.36; 'totally': 0.36; 'should': 0.36; 'too': 0.36; 'beyond': 0.37; '(for': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'things': 0.38; 'talk': 0.38; 'your': 0.60; 'wide': 0.62; 'url:it': 0.62; 'times': 0.63; 'url:cgi-bin': 0.66; 'url:tinyurl': 0.66; 'smith': 0.71; '4:00': 0.84; 'received:50.22': 0.84; 'tie': 0.84; 'url:share': 0.84; 'pm.': 0.91 Date: Tue, 20 Nov 2012 12:16:05 -0600 From: Tim Chase User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111120 Icedove/3.1.16 MIME-Version: 1.0 To: Roy Smith Subject: Re: Printing time in "at" format? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com 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: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353435321 news.xs4all.nl 6933 [2001:888:2000:d::a6]:53921 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33642 On 11/20/12 10:18, Roy Smith wrote: > I need to talk to an API which requires (for reasons totally beyond my > comprehension), time specified in "at" format, i.e. the format > accepted by the unix "at" command. This allows you to do such bizarre > things as use "teatime" to indicate 4:00 PM. The best I can find for > a specification is http://tinyurl.com/d5vddoa. > > Before I dive into this too far, has anybody already written some code > which formats times like that? Your statement can be ambiguously parsed as "I need to merely *generate* time specifications that 'at' can parse", or it can be parsed as "I need to generate *and consume* time specifications the same way as 'at' does" If it's the former, it's pretty easy--'at' accepts a wide variety of formats. If it's the latter, I've got a doc in /usr/share/doc/at/timespec on my Debian machine, which seems to be googleable, but here's one copy of it http://fts.ifac.cnr.it/cgi-bin/dwww/usr/share/doc/at/timespec I don't have a parser already, but that should get you a jump start on what (at least Debian's) 'at' parses, and might tie nicely with pyparsing. -tkc