I have a DateTime field (ex: CreatedDate) and would like to only show the date with the label. How would I setup the label expression to do this using python?
[GIS] Convert DateTime field to Just Date in Label Expression
arcgis-desktopdatetimelabelingpython
Best Answer
It is funny that python interpreter (field calculator) treats Arcgis datetime fields as unicode texts. to extract date from this string, we should convert it to datetime and then extract the date and then convert to string!
Standalone code (assuming you have a datetime formatted like
10/8/2015 3:24:53 AM
):label expression (python parser):