How to add in a set date to attribute table

545
6
Jump to solution
10-14-2021 04:26 AM
Labels (2)
AndrewEastop
New Contributor III

Hello,

Is there a way I can change the date in the DateCaptur field of my attribute table to say 06/07/2020 ? I had tried to do this as a calculate field expression but somehow came out with a date fro 1970!

Any help would be very much appreciated

0 Kudos
2 Solutions

Accepted Solutions
JayantaPoddar
MVP Esteemed Contributor

What about the following expression in Arcade? Put the date in double quotes.

 

"2020-07-06"

or

"06/07/2020"

 

 



Think Location

View solution in original post

Robert_LeClair
Esri Frequent Contributor

So I used Arcade for the Date calculation using Date(2020,5,7,0) on a Date/Time field and as seen in the attached file it calculated the field to be 6/7/2020 at 6 AM in this case.  The key is that the month field starts January as a zero and counts to 11 for December.  
DateCalc.JPG

View solution in original post

6 Replies
JayantaPoddar
MVP Esteemed Contributor

Where is the data stored? (Shapefile, File GDB, Enterprise GDB, etc.)

What expression did you use?

Have you tried (Arcade expression)

 

Date(2020,07,06)

 



Think Location
AndrewEastop
New Contributor III

The data is sorted in a filegdb.

Have tried to do the same expression you have said here and that is what gives me the random date. Got 09/02/1912 this time lol

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

What about the following expression in Arcade? Put the date in double quotes.

 

"2020-07-06"

or

"06/07/2020"

 

 



Think Location
AndrewEastop
New Contributor III

The double quotation did the trick... i hate code!

thanks very much

 

0 Kudos
Robert_LeClair
Esri Frequent Contributor

So I used Arcade for the Date calculation using Date(2020,5,7,0) on a Date/Time field and as seen in the attached file it calculated the field to be 6/7/2020 at 6 AM in this case.  The key is that the month field starts January as a zero and counts to 11 for December.  
DateCalc.JPG

AndrewEastop
New Contributor III

thank you for the reply Robert