Localtime to UTC in Python
Timezones are pretty nasty to work with in Python, especially when you have some local timezones you need in UTC. Piecing together a couple libraries gets you a solution:
https://gist.github.com/mathom/5347326


#batman#bruce wayne#batfam#dick grayson#tim drake#batfamily#dc fanart


seen from Germany

seen from Germany

seen from United States

seen from Australia

seen from Singapore

seen from Malaysia

seen from Germany
seen from Georgia
seen from United States
seen from Uruguay

seen from United States

seen from Malaysia

seen from United States

seen from Malaysia

seen from Malaysia
seen from United States

seen from Malaysia
seen from Germany
seen from United States
seen from United Kingdom
Localtime to UTC in Python
Timezones are pretty nasty to work with in Python, especially when you have some local timezones you need in UTC. Piecing together a couple libraries gets you a solution:
https://gist.github.com/mathom/5347326

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch โข No registration required โข HD streaming
python timezone
์ง๊ธ๊น์ง ๋ณ ์๊ฐ์์ด ํ์์กด์ ์ฒ๋ฆฌํ๊ณ ์์๋๋ฐ, ์ ์๊ฐ ์์ด ์ ์ฒ๋ฆฌํ๊ณ ์์๋ค. ์๋ฒ์ ๋ถ์์ฝ๋๋ฅผ ์ง๋ค๊ฐ ๋๊ด์ ๋ถ๋ช์ณค๋๋ฐ. ์๋์ ๊ฐ๋ค. >>> import pytz >>> from datetime import datetime >>> tz = pytz.timezone('Asia/Seoul') >>> datetime(2013, 2, 3, tzinfo=tz) datetime.datetime(2013, 2, 3, 0, 0, tzinfo=) >>> datetime(2013, 2, 3, tzinfo=tz).utcoffset() datetime.timedelta(0, 30600) ํ๊ตญ์ด ์ ํํ๋ +8:30๋ถ ์์น์ ์๊ธฐ๋ ํ์ง๋ง ์ผ๋ณธ๊ณผ ๊ฐ์ด +9:00๋ฅผ ์ฌ์ฉ ์ค์ด๋ค. ๊ทธ๋ฐ๋ฐ ์์ ๊ฐ์ ์ฝ๋๋ฅผ ์์ฑํ๋ฉด +8:30์ด ๋๋ฒ๋ฆฐ๋ค. pytz ๋ฌธ์๋ฅผ ๋ณด๋ ์๋์ ๊ฐ์ด ์ค๋ช ์ด ๋์ด ์์๋ค. > Note that this library differs from the documented Python API for tzinfo implementations; if you want to create local wallclock times you need to use the localize() method documented in this document. In addition, if you perform date arithmetic on local times that cross DST boundaries, the result may be in an incorrect timezone (ie. subtract 1 minute from 2002-10-27 1:00 EST and you get 2002-10-27 0:59 EST instead of the correct 2002-10-27 1:59 EDT). A normalize() method is provided to correct this. Unfortunately these issues cannot be resolved without modifying the Python datetime implementation. ๊ฒฐ๋ก ์... 1. datetime(year, month, day, tzinfo=timezone)์ ์ฌ์ฉํ์ง ๋ง ๊ฒ. 2. utc์๊ฐ์ด ์ ์ฅ๋ naive datetime์ timezone-aware datetime์ผ๋ก ๋ฐ๊พธ๋ ๊ฒฝ์ฐ localize๋ฅผ ์ฌ์ฉ * localize() : <timezone instance>.localize(<naive datetime>) 3. timezone-aware datetime์ ๋ค๋ฅธ timezone์ผ๋ก ๋ฐ๊พธ๋ ๊ฒฝ์ฐ * astimezone() : <timezone-aware datetime instance>.astimezone(<timezone instance>) 4. ์ฐ์ฐ์ ๊ฐ๋ฅํ๋ฉด utc์ํ์์ ํ๋ ๊ฒ์ด ์ข์ผ๋ local time์ผ๋ก ํ๊ณ ์ถ์๋๋ ๊ณ์ฐ์ ํ๊ณ ๋์ ๋ฐ๋์ normalize()๋ฅผ ํธ์ถํ ๊ฒ. ์๋จธํ์์ ๋ฑ์ ๋ณด์ ํด ์ค.