7

In my dataset, the data which contains house numbers are converted to date format in QGIS. Is there any script or tool to identify and convert them to normal format?

E.g. Case:

Actual Door No format is 11-10-60 and converts to Date format 11/10/1960

How can we identify the date format in the list of data and convert it back to the actual door no format?

3
  • 1
    To be clear: from a field house number, you want to convert the values to a date format which matches your example., am I right? Do the house numbers have a similar format to this one 'xx-xx-xx' ?
    – Padmanabha
    Sep 8 at 7:26
  • i want the door number format back (11-10-60)
    – Bruno B
    Sep 8 at 7:29
  • 1
    I guess its a CSV? Then you could just force QGIS to read this field as string.
    – MrXsquared
    Sep 8 at 7:36

1 Answer 1

10

If you import from CSV, change data type from Date to Text(string) when importing CSV.

enter image description here

Otherwise, add another field using the following expression in Field Calculator (set door number field before using).

lpad(month(door), 2, '0') || '-' || lpad(day(door), 2, '0') || '-' || right(year(door), 2)

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.