How to simplify time value output?

310
2
11-18-2020 05:46 PM
JulietK
Occasional Contributor

Hi, I have a time field which is currently giving outputs in a format like this 00:00:00.000+13:00.

I would rather have a more simplified output, like 12:00 (the 00:00:00.000+13:00 equals 12:00 in local time... which normal people won't be able to deduce quickly). How do I get the field to output the simpler value? 

If possible, I would prefer to not use calculations (I have reservations about calculating from 00:00:00.000+13:00 type format with daylight savings time changes etc), or create new fields. 

Thanks!

Tags (4)
0 Kudos
2 Replies
JamesTedrick
Esri Esteemed Contributor

Hi @JulietK ,

Just to check, this is displaying the value of a time (not date-time) question within another question or note on using the web form?  As time is stored as a string, you can use the subset() function to only show the first 5 characters.  Date-time questions can use the format-date() function to display components of the time.

0 Kudos
JulietK
Occasional Contributor

Hi James,

Apologies, I've re-read my question and what I was asking wasn't very clear. 

I have a datetime field which is visible on the survey and is filled by the respondents. I have a separate hidden field, which uses the format-date(${datetime}, '%H:%M') to extract the time. This hidden field is currently giving me the output that I want ('00:00' in 24hr time) - but if my understanding is correct, this is calculated from the datetime input which is in the 00:00:00.000+13:00 format (which I think is UTC + ).

I am unsure how the use of UTC+ works with changes in daylight savings time - so I'm wanting to find out whether there is a way to copy exactly what the respondents have entered in the datetime field into the hidden time field, without calculations using the UTC+ being involved. If the datetime entry is automatically calculated/entered in the database as UTC+ during the survey, I guess it would be impossible to achieve the above.. Would any concern around how accurately the survey will record time over daylight savings time changes be considered unnecessary?

Thank you for your response!

0 Kudos