How can I get rid of the time zone in the date/time field?
So I have a GeoPackage with the following data:
and want to get just 2021-06-07 16:25:40
How can I get rid of the time zone in the date/time field?
So I have a GeoPackage with the following data:
and want to get just 2021-06-07 16:25:40
In my QGIS (3.22), when I use datetime format, I get timezone information included by default. You can convert it to a string to get rid of it - use this expression, where datetime is the name of the field containing the datetime-information:
left(to_string(datetime), 19)
However, you can't use the resulting string field as a datetime field any more. Including timezone makes sense - as 2021-12-06 14:48:41 is not the same everywhere on Earth.
After inspecting provided GeoPackage I could not find the problem in any of your datetime fields, specifically "Save_times1" and "Loc1".
Proceed with RMC > Properties > Attributes Forms > Fields (see documentation) where change the Field Format from ISO Date Time into Date Time.
You need to go to the field calculator. Then tick update existing field. Select your desired field and type:
regexp_replace( "date" , '(MSK)', '')
Then hit OK. Good Luck.