Select to view content in your preferred language

AM / PM Calculation

903
2
Jump to solution
02-09-2022 02:41 PM
Badeschlapfen
New Contributor

Hi all,

I'm having the following problem:

I would like to calculate a field for AM / PM based on the survey time.

I used the following code in the calculation column (where ${SurveyDate} = now()): 

if(decimal-time(${SurveyDate})<0.5,"AM","PM") 

This works perfectly fine for the mobile version

Badeschlapfen_0-1644446278097.png

 

However, for the web version, it returns always PM regardless of the time. 
Is this a UTC offset issue? 

Does anyone have an idea how to solve this issue?
Thank you

0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

if(format-date(${wsdatetime},'%h')<12,"AM","PM")   This expression will work if wsdatetime is a datetime question

View solution in original post

0 Kudos
2 Replies
IsmaelChivite
Esri Notable Contributor

if(format-date(${wsdatetime},'%h')<12,"AM","PM")   This expression will work if wsdatetime is a datetime question

0 Kudos
Badeschlapfen
New Contributor

aw... of course. Thanks, @IsmaelChivite !

0 Kudos