Why is today() calculating with time as 12:00pm instead of 12:00am?

1364
5
03-30-2020 12:45 PM
AdamRepsher
Occasional Contributor III

Hi Everyone,

Again, I am working with covid-19 EMA operations here in Pennsylvania.

I have created a survey in survey123 connect a‌nd need to have users enter data via web browser.

In the xlsform,‌ I have a hidden type f‌ield that has a "today()" calculation and the "bind::esri:fieldType" set as "esriFieldTypeDate".

The "types" tab in the Advanced XLSForm says that the today() calculation should be giving me 12:00am.  When entries are submitted to this survey, I am getting 12:00pm (noon).

I need the date/time for each entry to be 12am to make the setup of date range filters in Operations Dashboard for ArcGIS‌ to be easy to set up and modify by our users.  If I default the TO side of the date range to "Today" then he current result (12pm) forces our users in the morning hours to change their TO date/time to either after noon, or the next day to see results coming in that day. The Dashboard setup does not allow me to define the TIME of the Max Default setting of "Today"  When the

0 Kudos
5 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Adam,

The field app and web app shifted to store a date at 12:00pm of the date in the local time zone to better address survey operations that occur across neighboring time zones as well as daylight savings shifts.

AdamRepsher
Occasional Contributor III

So, James,

Is there a way to calculate that field instead of using today() to actually get 12:00am in that field?

Operations Dashboard for ArcGIS‌ forces us to use a range date/time selector that does not allow further definition of the "TODAY" default.  When set up with the default TODAY in the second field of the Date Range, the end user of the Dashboard only sees the entries coming from the survey before the time they opened the dashboard.  I cannot default the Data Range selector past just TODAY with the user's current time.

Actually - when I just opened this dashboard, I am now seeing that the TODAY default for the second part of the date range seems to be going to TOADY at 12:00AM.  Now it isn't even returning the records up to the time I open the page in my browser!

For now, I have just used the limited Date Selector Label to tell my users to adjust the range:

in-app Date Range selector

This is not a great solution for my users working the covid-19 c‌risis.  

Any help to make this a background effort, one that the user can just open the tool and see the information needed instead of having to remember to make adjustments first, would be greatly appreciated.

I wonder how to cross-post this to Operations Dashboard for ArcGIS‌???

Thank you for reading,

--Adam

0 Kudos
IsmaelChivite
Esri Notable Contributor

once(today() + 12*60*60*1000)  You can add this to the calculation column of the question where you want to calculate 'today at night'.

0 Kudos
AdamRepsher
Occasional Contributor III

Just for clarification, this would give me the current date, but 12am (0000 hrs) as the time for each entry?  That is what I am looking for.

This looks like it will calculate the next day at midnight if I understand what is going on.

Maybe once(today() - 12*60*60*1000) ?

Thank you so much!

--Adam

0 Kudos
AdamRepsher
Occasional Contributor III

Ismael Chivite wrote:

once(today() + 12*60*60*1000)  You can add this to the calculation column of the question where you want to calculate 'today at night'.

Ismael Chivite‌,

Entering once(today() + 12*60*60*1000) in the calculation column produces a NULL result.

Just in case it matters, my setup:

  • The survey is being created in Survey123_Connect_for_ArcGIS
  • It is being published to ArcGIS Online
  • The end user is completing the survey through a web browser.

Any ideas?

Thanks,

--Adam

0 Kudos