I have date values with the format d-m-yyyy in QGIS. They are in string field. I want to convert them into date values with the format yyyy-mm-dd. I want them in a date field.
Can this be done without doing something in Python?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
I would recommend to use the
Expression would be:
to_date( concat(regexp_substr("old_date", '([^-]+$)'), '-', lpad(regexp_substr("old_date", '[-](\\d*)[-]'), 2, 0), '-', lpad(regexp_replace("old_date", '([-].*$)', ''), 2, 0) ) )
"old_date" by your actual string field.