Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76352

Re: timedelta problem

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'attribute': 0.07; 'valueerror:': 0.09; 'python': 0.11; '36,': 0.16; '46,': 0.16; 'directive': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'import': 0.22; 'aug': 0.22; 'email addr:gmail.com&gt;': 0.22; 'subject:problem': 0.24; '&gt;': 0.26; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'class': 0.32; 'fri,': 0.33; 'skip:t 40': 0.33; 'skip:d 20': 0.34; 'received:google.com': 0.35; '14,': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'bad': 0.39; 'to:addr:python.org': 0.39
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=cdNcj1DjyTL/j5nSXleAuXi2g2fiJw/3EtLyvh3XTnU=; b=HXV/39I4MHUnLfGqleVItR2a/JO0oP+0Yfuf9YEMoBdOduv1DJGwUJgyXMvRUqT1Xz gR5ALBKhGUWlZgpJMZqqCWTASEYmPvXkrKiFbaidE5KXl6izOPiHHWvGNkX0PbQI92ms bkg0Lm07gTs+IyPhsM13VQmuAqCx9goHKObk1XPlwEWAw9gmPU72nnvbmwxQqTI8AykM 2+cXCaaxXjxIQZqwTlOv9SFIlicXw46DZ124MzWrtRqIcKe7kc2pMPNguh9MBJD/6gJL /YpLaCXmgNKG1pe0DFiXisac5uJZQr5v1poh4+XZ3J3CNijbhZMTxa0NWHVK+0zS18WU m4BQ==
X-Received by 10.66.119.174 with SMTP id kv14mr8794838pab.52.1408075298171; Thu, 14 Aug 2014 21:01:38 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <lsk03m$osa$8@dont-email.me>
References <mailman.13018.1408069502.18130.python-list@python.org> <lsk03m$osa$8@dont-email.me>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Thu, 14 Aug 2014 22:00:58 -0600
Subject Re: timedelta problem
To Python <python-list@python.org>
Content-Type multipart/alternative; boundary=e89a8ffbaa25f8b0ac0500a31372
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13026.1408075301.18130.python-list@python.org> (permalink)
Lines 50
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1408075301 news.xs4all.nl 2966 [2001:888:2000:d::a6]:45067
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76352

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, Aug 14, 2014 at 9:51 PM, Denis McMahon <denismfmcmahon@gmail.com>
wrote:
>
> On Fri, 15 Aug 2014 10:24:47 +0800, luofeiyu wrote:
>
> > import datetime
> > t1='Sat, 09 Aug 2014 07:36:46 -0700'
> > t2='Sat, 09 Aug 2014 07:36:46 +0700'
> > datetime.datetime.strptime(t1,"%a, %d %b %Y %H:%M:%S %z")
>
> Are you sure? When I try this I get:
>
> ValueError: 'z' is a bad directive in format '%a, %d %b %Y %H:%M:%S %z'
>
> > datetime.datetime(2014, 8, 9, 7, 36, 46,
> > tzinfo=datetime.timezone(datetime.timedelta(-1, 61200)))
>
> And this:
>
> AttributeError: 'module' object has no attribute 'timezone'

The datetime.timezone class was added in Python 3.2.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

timedelta  problem luofeiyu <elearn2014@gmail.com> - 2014-08-15 10:24 +0800
  Re: timedelta  problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-08-15 03:51 +0000
    Re: timedelta problem Chris Angelico <rosuav@gmail.com> - 2014-08-15 13:59 +1000
    Re: timedelta problem Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-14 22:00 -0600
  Re: timedelta  problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-08-15 07:39 +0000
    Re: timedelta  problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-08-15 08:44 +0000
    Re: timedelta problem Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-15 09:23 -0600
      Re: timedelta problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-08-15 17:43 +0000
        Re: timedelta problem Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-15 12:05 -0600
    Re: timedelta problem Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-15 17:29 +0100
  Re: timedelta  problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-08-15 09:36 +0000

csiph-web