Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!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.051 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'subject:not': 0.03; "'%b": 0.16; 'isnt': 0.16; '>>>': 0.22; 'import': 0.22; 'to:name:python- list@python.org': 0.22; '>>>': 0.24; 'skip:% 10': 0.24; 'wondering': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'run': 0.32; 'skip:d 20': 0.34; 'something': 0.35; 'received:google.com': 0.35; 'subject:skip:d 10': 0.36; 'doing': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'read': 0.60; 'pad': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=7koH9XU2m8lJpdUWJl1oH9X8mzDiR7j/Z2kAVuOB1DE=; b=Vj5aDqg5J4fQxW6sWNSeOCMdzsMcNicfXt3Srzv6t0u9+psBIp3OYPSdEvVURurEaX KjAtaRaHR4fTcgLRr32D+nRV+WqbF3ra2kq7DaUIVCtPu29ey5GhNM5lYzF9yq8kMJUL kzDS0CUJ9jxwbrlUgEcyIYnIhCRzVEmRZOPpKzbxoNdhnz8J3JiOKCwrnuD4+/9oLCeH VZEH63DbCcPayI9lWIzjwhyA3o/aGDB1Yl41ylxTjVXQQSQv2MohK1DwGKLDitqszVdE QY96zoTWn2T2FnsOur2XnTu8nsIPovWp6uIy9Q88Saip93TyYh/Z9Yur89rhJwzN6uC2 lusQ== X-Received: by 10.182.105.2 with SMTP id gi2mr17298515obb.15.1366751720602; Tue, 23 Apr 2013 14:15:20 -0700 (PDT) MIME-Version: 1.0 From: Rodrick Brown Date: Tue, 23 Apr 2013 17:14:50 -0400 Subject: datetime.strptime() not padding 0's To: "python-list@python.org" Content-Type: multipart/alternative; boundary=e89a8ff1cdf0cd860504db0daeae 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: 1366751728 news.xs4all.nl 2259 [2001:888:2000:d::a6]:45297 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44216 --e89a8ff1cdf0cd860504db0daeae Content-Type: text/plain; charset=ISO-8859-1 I thought I read some where that strptime() will pad 0's for day's for some reason this isnt working for me and I'm wondering if i'm doing something wrong. >>> from datetime import datetime >>> dt = datetime.strptime('Apr 9 2013', '%b %d %Y') >>> dt.day 9 >>> How can I get strptime to run 09? instead of 9 --RB --e89a8ff1cdf0cd860504db0daeae Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I thought I read some where that strptime() will pad 0'= ;s for day's for some reason this isnt working for me and I'm wonde= ring if i'm doing something wrong.=A0

>>&= gt; from datetime import datetime
>>> dt =3D datetime.strptime('Apr 9 2013', '%b %d= %Y')
>>> dt.day
9
>>>

How can I get st= rptime to run 09? instead of 9=A0


--RB=A0
--e89a8ff1cdf0cd860504db0daeae--