This may seem like a simple question, but I'm having problems. According to the "Fundamentals of date fields" in ArcGIS 10.3.1, " a shapefile stores dates in a date field with this format: yyyy-mm-dd". However, when I put 2017-03-07 into my field, formatted as a date field, in Field Calculator, what comes out is 29/06/1905! If I just enter that into the individual field, it works fine, just not in the field calculator, and unfortunately I need to populate a number of shapefiles, each with several hundred rows.
What am I doing wrong?
Solved! Go to Solution.
did you try
datetime.datetime(2000, 12, 31)
No, but I have now, and it works
Thank you.
Hi Dan,
This works, but it comes out in US format (mm/dd/yyyy). Is there a way so that it works in UK (dd/mm/yyyy). I know that I can alter the display in pop-ups and the attribute table, but when I set up a query in Portal, it is asking for input in US, which could confuse my potential users.
Thanks
Simon... I don't do the portal thing, and the inputs to datetime can be constructed from the individual year, month, day components, but you can't switch their order in datetime.datetime. Display for your locale can be controlled by windows.
I only work with standardized YYYY-MM-DD format so I have little experience with localized preferences
Hi Dan,
Thanks anyway. At least you got my data to appear in the right century! I'll try other tacks.