Questions tagged «pytz»

7
有Pytz时区列表吗?
我想知道Python库pytz中timezone参数的所有可能值是什么。怎么做? 解 for tz in pytz.all_timezones: print tz Africa/Abidjan Africa/Accra Africa/Addis_Ababa Africa/Algiers Africa/Asmara Africa/Asmera Africa/Bamako Africa/Bangui Africa/Banjul Africa/Bissau Africa/Blantyre Africa/Brazzaville Africa/Bujumbura Africa/Cairo Africa/Casablanca Africa/Ceuta Africa/Conakry Africa/Dakar Africa/Dar_es_Salaam Africa/Djibouti Africa/Douala Africa/El_Aaiun Africa/Freetown Africa/Gaborone Africa/Harare Africa/Johannesburg Africa/Juba Africa/Kampala Africa/Khartoum Africa/Kigali Africa/Kinshasa Africa/Lagos Africa/Libreville Africa/Lome Africa/Luanda Africa/Lubumbashi Africa/Lusaka Africa/Malabo Africa/Maputo Africa/Maseru Africa/Mbabane Africa/Mogadishu …
658 python  django  pytz 

1
如何从日期时间对象中删除pytz时区?
有没有一种简单的方法可以从pytz datetime对象中删除时区? 例如,dt从dt_tz本示例中进行重构: >>> import datetime >>> import pytz >>> dt = datetime.datetime.now() >>> dt datetime.datetime(2012, 6, 8, 9, 27, 32, 601000) >>> dt_tz = pytz.utc.localize(dt) >>> dt_tz datetime.datetime(2012, 6, 8, 9, 27, 32, 601000, tzinfo=<UTC>)
120 python  timezone  pytz 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.