python - Get local time reflected on PC and not other time zone -


i using python v3.6 current time.

import time current_time = time.strftime("%h:%m:%s %y-%m-%d", time.gmtime()) 

the code works time retrieved other time zones. how retrieve time same reflected on windows 10 clock on pc?

try below. expect gmtime gmt(utc more likely), vs local. see https://docs.python.org/2/library/time.html

    >>> time.strftime("%h:%m:%s %y-%m-%d", time.gmtime())     '03:16:00 2017-08-20'     >>> time.strftime("%h:%m:%s %y-%m-%d", time.localtime())     '13:16:08 2017-08-20 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -