Set field date format in bulk

238
5
09-14-2021 08:05 AM
GeoguichetGeoguichet
New Contributor III

Hello all,

I would like to set the date format to only date and the dd.mm.yyyy format. It is possible to do that in the layer field settings under Number Format. However having a lot of layers and a lot of fields I would like to program to set all the date formats in bulk. Is that possible? 

Thank you!

0 Kudos
5 Replies
DanPatterson
MVP Esteemed Contributor

What is your windows date format set to?

Date fields—ArcGIS Pro | Documentation


... sort of retired...
0 Kudos
GeoguichetGeoguichet
New Contributor III

Thank you for the answer and sorry not to specify better my issue.

My Windows regional settings as set as I want and so the displaying of the dates in ArcGIS Pro is not a problem.

The problem is when I publish the data to the Portal. If no specific parameter set in ArcGIS Pro all dates are by default displayed in the US format (mm/dd/yyyy 2:00 AM). That is why I need to set all the fields and I am looking for a way to do that automatically if possible.

0 Kudos
DanPatterson
MVP Esteemed Contributor

 . .. .. ArcGIS Pro uses Python functions and the display format depends on your regional settings, rather than the underlying database's format on the system....

I wonder if it a portal issue then since Pro and python seem to have you covered for the display you want


... sort of retired...
0 Kudos
GeoguichetGeoguichet
New Contributor III

Yes indeed its a problem of the Portal. So I need to make sure to define the format of the field in ArcGIS Pro before publishing. If I set it manually in the ArcGIS Pro, when published on the portal is in a good format. So instead of setting it manually I wonder how I can do it with arcpy or with ModelBuilder. Do you know if it is possible? 

0 Kudos
DanPatterson
MVP Esteemed Contributor

I don't do Portal.

With python you can set date formats to whatever you want.

Arcpy would wrap around what is available

Maybe the "arcgis" module ArcGIS API For Python | ArcGIS Developer

but I don't have much call to use it.

 


... sort of retired...
0 Kudos