"Nicholas F. Fabry" <[EMAIL PROTECTED]> writes:
> The constructor for class datetime has a method, .now() that returns
> the current date and time, as a naive datetime object (i.e. no
> tzinfo attached).
It's not "the constructor for class 'datetime'" that has that method;
rather, the class 'date
On Jan 29, 2008, at 13:56, nik wrote:
> Thanks,
> that does help and now I have:
>
from datetime import datetime, tzinfo, timedelta
import time
class TZ(tzinfo):
> ...def utcoffset(self,dt): return timedelta(seconds=time.timezone)
> ...
print datetime(2008,2,29,15,30,11,tz
En Tue, 29 Jan 2008 16:56:18 -0200, nik <[EMAIL PROTECTED]> escribi�:
print datetime(2008,2,29,15,30,11,tzinfo=TZ()).isoformat()
> 2008-02-29T15:30:11+8:00
>
> But what I want to know now it how to get the actual time into the
> expression instead of typing the 2008,2,29,15
> So something
On Jan 29, 10:56 am, nik <[EMAIL PROTECTED]> wrote:
> Thanks,
> that does help and now I have:
>
> >>> from datetime import datetime, tzinfo, timedelta
> >>> import time
> >>> class TZ(tzinfo):
>
> ...def utcoffset(self,dt): return timedelta(seconds=time.timezone)
> ...>>> print datetime(2008,2
Thanks,
that does help and now I have:
>>> from datetime import datetime, tzinfo, timedelta
>>> import time
>>> class TZ(tzinfo):
...def utcoffset(self,dt): return timedelta(seconds=time.timezone)
...
>>> print datetime(2008,2,29,15,30,11,tzinfo=TZ()).isoformat()
2008-02-29T15:30:11+8:00
But
Hello, nik.
On Jan 28, 2008, at 21:03, nik wrote:
> Hi,
>
> How does one express the time in ISO format with the timezone
> designator?
>
> what I want is -MM-DDThh:mm:ss.sTZD
>
>> From the documentation I see:
from datetime import tzinfo, timedelta, datetime
class TZ(tzinfo):
> ...
Hi,
How does one express the time in ISO format with the timezone
designator?
what I want is -MM-DDThh:mm:ss.sTZD
>From the documentation I see:
>>> from datetime import tzinfo, timedelta, datetime
>>> class TZ(tzinfo):
... def utcoffset(self, dt): return timedelta(minutes=-399)
...
>>>