I have created a quick capture project and field map project using the same hosted feature layer. Within this layer, I have a date field which uses a calculated expression of:
Now()
which gets the current date and time of user input.
I then have a string field which formats this date to how I want.
An example of this would be
dd/mm/yyyy, hh:mm AM/PM
12/04/2024, 10:45 AM
This arcade expression is:
// Input Date
// AM or PM for minutes
var ampm = When(Hour(Now()) < 12, "AM", "PM");
// Getting current minutes/s
var minutes = Minute(Now());
// Adding 0 when the minute is a single digit
var paddedMinutes = When(minutes < 10, "0" + minutes, Text(minutes));
// Getting a current hour
var hours = Hour(Now());
// Adding 0 when the hour is a single digit
var paddedhours = when(hours<10,"0"+hours, Text(hours));
// Getting current day
var days = Day(Now());
// Adding 0 when the day is single digit
var paddeddays = when(days<10,"0"+days, Text(days));
// Adding 1 to adjust for zero-indexed months
var months = Month(Now()) + 1;
// Adding 0 when the month is single digit
var paddedmonths = when(months<10, "0"+months, Text(months));
// Final code
paddeddays +
"/" +
paddedmonths +
"/" +
ISOYear(Now()) +
", " +
paddedhours +
":" +
paddedMinutes +
" " +
ampm;
This is the result when I see the data in ArcGIS Online (see attached).
The dates where it is working are all points collected in field maps while the ones where it hasn't are all in QuickCapture.