Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:into': 0.09; 'subject:number': 0.09; 'subject:string': 0.09; 'cc:addr:python- list': 0.11; 'python': 0.11; '-tkc': 0.16; 'from:name:tim chase': 0.16; 'module?': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'subject:time': 0.33; 'subject:the': 0.34; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'how': 0.40; 'to:addr:gmail.com': 0.65; 'received:50.22': 0.84 Date: Wed, 13 Aug 2014 21:01:11 -0500 From: Tim Chase To: luofeiyu Subject: Re: how to change the time string into number? In-Reply-To: <53EC14EC.2090503@gmail.com> References: <53EC14EC.2090503@gmail.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 - thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: authenticated_id: 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407981761 news.xs4all.nl 2856 [2001:888:2000:d::a6]:37450 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76246 On 2014-08-14 09:46, luofeiyu wrote: > s="Aug" > > how can i change it into 8 with some python time module? >>> import time >>> s = "Aug" >>> time.strptime(s, "%b").tm_mon 8 works for me. -tkc