This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, kliano
Date 2017-09-30.03:50:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1506743434.41.0.213398074469.issue31646@psf.upfronthosting.co.za>
In-reply-to
Content
mktime() is the inverse of localtime(). With the given format string, strptime() sets tm_isdst to -1, for which mktime will use the system's timezone information to determine whether or not it's daylight saving time. You need to verify that the time zones are the same. 

For me the results agree in Linux and Windows with the local timezone on both systems set to the UK.

9 March (GMT, standard time)

    Linux
    >>> time.mktime(time.struct_time((2014, 3, 9, 2, 0, 0, 6, 68, 0)))
    1394330400.0
    >>> time.mktime(time.struct_time((2014, 3, 9, 2, 0, 0, 6, 68, -1)))
    1394330400.0

    Windows
    >>> time.mktime(time.struct_time((2014, 3, 9, 2, 0, 0, 6, 68, 0)))
    1394330400.0
    >>> time.mktime(time.struct_time((2014, 3, 9, 2, 0, 0, 6, 68, -1)))
    1394330400.0

9 August (BST, daylight saving time)

    Linux
    >>> time.mktime(time.struct_time((2014, 8, 9, 2, 0, 0, 6, 68, 1)))
    1407546000.0
    >>> time.mktime(time.struct_time((2014, 8, 9, 2, 0, 0, 6, 68, -1)))
    1407546000.0

    Windows
    >>> time.mktime(time.struct_time((2014, 8, 9, 2, 0, 0, 6, 68, 1)))
    1407546000.0
    >>> time.mktime(time.struct_time((2014, 8, 9, 2, 0, 0, 6, 68, -1)))
    1407546000.0
History
Date User Action Args
2017-09-30 03:50:34eryksunsetrecipients: + eryksun, kliano
2017-09-30 03:50:34eryksunsetmessageid: <1506743434.41.0.213398074469.issue31646@psf.upfronthosting.co.za>
2017-09-30 03:50:34eryksunlinkissue31646 messages
2017-09-30 03:50:34eryksuncreate