I have two code segments set up which return a date to the user. The first one converts the date from the CET time zone to CST and appears as follows:
from datetime import datetime
from pytz import timezone
import pytz
fmt = '%Y-%m-%d %H:%M:%S %Z%z'
cet = pytz.timezone("CET")
install_date = datetime(day=18, month=5, year=2015, hour=18, minute=00, second=00, tzinfo=cet)
hometime = timezone('Canada/Saskatchewan')
loc_dt = install_date.astimezone(hometime)
result=loc_dt.strftime(fmt)
which returns the correct result:
2015-05-18 11:00:00 CST-0600
For the second segment, I just want the date returned under the CST timezone to ensure that it will not be affected by daylight savings time:
from datetime import datetime
from pytz import timezone
import pytz
fmt = '%Y-%m-%d %H:%M:%S %Z%z'
cst = pytz.timezone('Canada/Saskatchewan')
calibration_date = datetime(day=2, month=6, year=2015, hour=10, minute=00, second=00, tzinfo=cst)
result = calibration_date.strftime(fmt)
which returns the result:
2015-06-02 10:00:00 LMT-0659
Notice the LMT-0659 result. I need it to return CST-0600 since CST is unaffected by daylight savings time. I am not sure why the conversion segment would return the CST time zone while the LMT time zone is returned in the second segment.
Does anyone know why I am receiving the LMT-0659 result and what time zone I should be using to obtain the correct CST-0600 time zone? Should I just use the 'Etc/GMT+6' time zone instead to avoid any daylight savings issues in the future?