Case 1
>>> datetime.__file__
'/usr/lib/python2.6/lib-dynload/datetime.so'
>>> print datetime.datetime.now()
2010-05-19 19:45:40.202634
Case 2
from django.db import models
import datetime
print datetime.__file__
print "--------------------------", datetime.datetime.now()
———–Result——–
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Validating models...
/usr/lib/python2.6/lib-dynload/datetime.so
-------------------------- 2010-05-19 09:16:43.987508
0 errors found
As Mark pointed it looks like time zone difference for Japan:
Standard
datetimemodule handle naive time only, you can add a support of time zones withdateutil(especiallydateutil.tz.tzlocal()constructor).