0

So I created a Date field in a dataset with 5 rows and so I then right clicked on Calculate Field to enter the date (all 5 rows have the same date). The date I entered was 1/1/2022 but Pro did not like the format and entered the date as 1899 something something with some time.

The dataset is a feature class stored in a local geodatabase.

So how can I like enter the date value in the correct format in ArcGIS Pro 3.1 ?

5
  • 1
    The ISO format for date entry is YYYY-MM-DD. Please Edit the question to indicate the storage format for your table (shapefile, FGDB, EGDB), since the formatting can be different for each provider.
    – Vince
    Nov 13, 2023 at 17:21
  • 1
    Suggest you upgrade to 3.2, they have a new date only data type specifically for this issue.
    – Hornbydd
    Nov 13, 2023 at 17:22
  • @Hornbydd oh I see, cheers for pointing that out so is date only like different from the regular date data type as the latter contains both date and time. Nov 13, 2023 at 17:32
  • @Vince yeah so you know when you double click on the field in the attribute table a calendar icon appears for the user to select a date. So on that calendar I selected January 1st 2022 instead of typing in the date. So once I entered the date it showed up as 1/1/2022 so I thought okay that might be the format that I am suppose to use in calculate field but I guess that's not the case. As when I entered 1/1/2022 in the Field Calculator Pro` did not recognize it and instead entered the date as 1899 something with some time Nov 13, 2023 at 17:35
  • 1
    Simply put your date in quotes, "1/1/2022", and ArcGIS Pro will parse the string representation of a date to a datetime object and insert it into the Date ArcGIS field. In an ArcGIS Date field, which is really a date and time combination field, if you only want to see the date and not a date and time, set the time to 00:00 and it won't display when viewing in a table.
    – bixb0012
    Nov 15, 2023 at 23:27

3 Answers 3

2

So, it turns out that I was not using the datetime function in the field calculator. Hence, when I typed datetime.datetime(2022, 1, 11), Pro was able to pick the correct date that is 1/11/2022.

1
  • 1
    As I mentioned in my comment to your original question, you can simply quote your date value to have it parsed correctly as a datetime object.
    – bixb0012
    Nov 15, 2023 at 23:30
1

An easier way might be using the Attributes pane.

You access the Attributes pane via the Edit tab in the Selection group by clicking the button labeled "Attributes". That will open the pane shown below, this pane is divided into a tree view on top and an attributes view on the bottom.

The attributes pane in its default state only shows attributes for the selected features. You can select the individual features in the tree view and update attributes in the attributes view. In your case, you would select the layer name at the top of the tree view, then enter your values in the appropriate field in the attributes view - this will update that field's value for all of the selected features. If you're entering dates, you can also use the calendar picker tool when the field is activated.

I have created a video showing some of the uses of the attributes pane.

enter image description here

2
  • Can you please expand to how to access Attributes pane and select the layer name in the tree view in your answer? Nov 15, 2023 at 20:33
  • 1
    Just updated the answer to be more clear on how to access and use the attributes pane.
    – GIS Chops
    Nov 15, 2023 at 22:26
0

Settings on your Windows system determine how the dates display in ArcGIS Pro—M/d/yy, MM/dd/yy, yy/MM/dd, and so on.

My system date is dd/MM/yyyy, and the field calculator accepts all possible short-form dates (inside personal geodatabase).

2
  • Oh I see so I had to type in the date as 01/01/2022 instead of 1/1/2022? Nov 13, 2023 at 17:38
  • 1
    On my PC it works with both, however, keep in mind the Regional Format. I'm using English (United Kingdom) so the default format is dd/MM/yyyy, if I type 02/23/2022 it will swap 23 with 02 to fit my PC format.
    – riflo
    Nov 14, 2023 at 11:33

Your Answer

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

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