TransWikia.com

Converting Unix epoch time to GMT time using QGIS Field Calculator

Geographic Information Systems Asked on March 31, 2021

I am trying to convert the ‘time’ and ‘updated’ column from epoch to date/time GMT but I am struggling to do so. I know I have to use the field calculator tab but I am a basic at using scripting.

I am using QGIS.

enter image description here

One Answer

In the QGIS python console, you should be able to run something like:

import datetime
datetime.datetime.fromtimestamp({your epoch time}).strftime('%c')

Note that strftime can be formatted in many ways, but the time zone will be UTC. For instance, you could instead use the following: strftime('%Y-%m-%d %H:%M:%S') (See strftime for the possible formatting values)

Answered by user25839 on March 31, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP