$ TZ=KST-9 date
# Thu Oct 3 15:51:21 KST 2013
$ date
# Thu Oct 3 09:51:23 FET 2013
$ ls /usr/share/zoneinfo
Africa Asia Canada
.....
$ ls /usr/share/zoneinfo/Europe
Amsterdam Belgrade Bucharest Copenhagen Helsinki
.....
$ cat /etc/timezone
Europe/Minsk
python -c "import pytz;print pytz.all_timezones"
['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers',
.....
import datetime, pytz
korea_tz = pytz.timezone('Asia/Seoul')
korea_time = korea_tz.localize(datetime.datetime(2013, 10, 2, 14, 0))
# datetime.datetime(2013, 10, 2, 14, 0, tzinfo=<DstTzInfo 'Asia/Seoul' KST+9:00:00 STD>)
local_time = korea_time.astimezone(pytz.timezone('Europe/Minsk'))
# datetime.datetime(2013, 10, 2, 8, 0, tzinfo=<DstTzInfo 'Europe/Minsk' FET+3:00:00 STD>)
List of time zone abbreviationsList of time zones by country
No comments:
Post a Comment