[Python-ml-jp 4695] Re: Python2.5 の datetime.now()の挙動
荊尾和宏
kario @ triad-sol.co.jp
2009年 3月 9日 (月) 00:20:20 JST
カリオです。
Lennyの環境で試してみましたが
Ubuntu同様、実行出来ました。
-----------------------------------------------------------------------------------------------------------
$> uname -a
Linux lenny 2.6.26-1-686 #1 SMP Sat Jan 10 18:29:31 UTC 2009 i686 GNU/Linux
$> python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>> import datetime
>> datetime.datetime.now()
datetime.datetime(2009, 3, 9, 0, 14, 25, 239536)
-----------------------------------------------------------------------------------------------------------
とりあえず、動いたというご報告です。
2009/3/8 荊尾和宏 <kario @ triad-sol.co.jp>:
> 初めまして。
> カリオです。
>
> Lennyの環境が手元に無いので、
> Ubuntu 8.10(x64)
> Python 2.5.2
> の環境で試してみましたが、こちらでは
> 2.4と同様、実行できるようです。
> -----------------------------------------------------------------------------------------------------------
> $> python
> Python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17)
> [GCC 4.3.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import datetime
>>>> datetime.datetime.now()
> datetime.datetime(2009, 3, 8, 22, 15, 12, 565874)
> -----------------------------------------------------------------------------------------------------------
>
>
> とりあえずご報告まで。
> #lennyの環境で検証出来たら、またご連絡しますね。
>
>
>
> 2009/3/8 tao <tao_0077 @ yahoo.co.jp>:
>> タオです。
>>
>> Debian が Lenny になったのを機に 2.4 で実行できていたスクリプトの検証を
>> しています。(Lenny の Python パッケージは 2.5.2)
>> が、2.4 で実行できていた datetime.now() でエラーができます。
>> ----------------------------------------------------
>>>>> import datetime
>>>>> datetime.datetime.now()
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> ValueError: hour must be in 0..23
>> ----------------------------------------------------
>>
>> 2.4 on etch では
>> ----------------------------------------------------
>>>>> import datetime
>>>>> datetime.datetime.now()
>> datetime.datetime(2009, 3, 9, 5, 57, 12, 369679)
>> ----------------------------------------------------
>> と実行できていました。
>>
>> 2.5 のマニュアルを見ても、引数無しで datetime オブジェクトを返すとなって
>> いるのですが、何か仕様が変わったのでしょうか?
>>
>> 以上、よろしくお願いします。
>> _______________________________________________
>> Python-ml-jp mailing list
>> Python-ml-jp @ python.jp
>> http://www.python.jp/mailman/listinfo/python-ml-jp
>>
>
Python-ml-jp メーリングリストの案内