google-colaboratorysystemtime

Changing the System Time in Google Colaboratory


I would like to use my local time as the System Time in Google Colab, but I believe by default it is set to UTC time as indicated here: Current Date Format

How am I able to change the system time to my local time?


Solution

  • Here's how to do it. For me, I live in Asia/Bangkok

    !rm /etc/localtime
    !ln -s /usr/share/zoneinfo/Asia/Bangkok /etc/localtime
    !date
    

    Now I get Tue Apr 30 20:12:30 +07 2019. You can see the list of timezones by

    !ls -al /usr/share/zoneinfo
    

    And go into sub-directories for each group. (or simply search google)