I am trying to convert a string column that contains date and time values into a datetime column in QGIS. The format of the string column is (yyyy-mm-dd hh:mm:ss). I write the expression as to_datetime("DateTime", 'yyyy-mm-dd hh:mm:ss'), but get an error message saying that I cannot convert that specific column to datetime. As far as I know, the layer is saved as a GeoPackage.
1 Answer
The doc says mm
is for minutes, MM
for months
Try with to_datetime("DateTime", 'yyyy-MM-dd hh:mm:ss')