Daylight savings time in Python
问题 I am writing a program which deals a lot with timezones and crossing them. The two things I deal with most are creating a datetime object from "now" and then localizing a naive datetime object. To create a datetime object from now in the pacific timezone, I am currently doing this (python 2.7.2+) from datetime import datetime import pytz la = pytz.timezone("America/Los_Angeles") now = datetime.now(la) Is this correct with regards to DST? If not, I suppose I should be doing: now2 = la.localize