Hello!
I'm using Power Automate to send a confirmation email when a survey is submitted. I have a dateTime field within my survey and I am interested in converting the time to be understandable within an email. As I understand it the survey contains the date/time in Epoch time. I found an article explaining how to perform this conversion but I seem to be doing something wrong, because the Power Automate process throws an error on my expression.
Link to the conversion article - https://support.esri.com/en/technical-article/000023954
And here is my expression -
addSeconds('1970-1-1', Div(triggerBody()?['feature']?['attributes']?['datetime'],1000))
If anyone has done this conversion before and has information it would be appreciated!
Thanks.
Solved! Go to Solution.
I think you are just missing the format string at the end.
addSeconds('1970-1-1',Div(triggerBody()?['feature']?['attributes']?['yourdatequestion'] ,1000),'yyyy-MM-dd')
I think you are just missing the format string at the end.
addSeconds('1970-1-1',Div(triggerBody()?['feature']?['attributes']?['yourdatequestion'] ,1000),'yyyy-MM-dd')
@IsmaelChivite, I've followed your instructions but my conversion is failing using the code. Following your exact instructions are insert the following code but then showing as an invalid code. Any changes to this process or pointer for what I am doing incorrectly?
Hi Ismael @IsmaelChivite
I used your logic for the Date/Time and I don't get the correct time in the email. I created a test record set to Dec 25, 2021 @1pm and the email was generated for Date as Dec 24, 2021 @7pm. any suggestions? Thank you!
Lacri
@Ursu_Lacramioara Date objects in an esriFieldTypeDate column are stored in UTC. That explains the difference you see.
You can convert the time zone as shown in the diagram below. If you are using the Convert time zone module, you do not need to include the date format parameter in the addSeconds operation.
I'm trying to convert my date to MM-DD-YYYY format and I've followed the instructions but my conversion is failing using the code. Following the exact instructions that are written and inserting the following code, but then showing as an invalid code. Any changes to this process or pointer for what I am doing incorrectly?
Hi Nicholas - this is what i have in my flows for Add to Time:
Div(triggerOutputs()?['body/feature/attributes/SiteVisitDate'],1000)
@Ursu_Lacramioara Thanks! This seem to have fixed my first issue. Since my Date field is a date only field, are you aware of any ways of getting the Thh:mm:ss:ms portion of the date field removed?
do you have this, where Calculated Time equals to body ('Add_to_time')