cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Paul-Prime92
New Member

Timestamp appearing wrong

Hi, 

I'm trying to get the date to correctly display in my Google Sheets but when I convert the current time it's basically displaying the time (PM) as an AM time. e.g. My command is run at 17:11 PM but it's showing 05:11 - How can I go about fixing this? I'm currently using the following for the time.

 

PaulPrime92_0-1660148303953.png

And I'm getting the below from the output - It appears to be 12 hours out but the destination time zone should be correct.

PaulPrime92_2-1660148394913.png

please note were currently on UTC(+1) due to BST but the output should be showing as 17:06:10 in the above 

 

If there's any other ways to go about this I would be most appreciative as I was originally using the utcnow() within formatdatetime prior to switching over to this method due to wrong times being displayed. Any advice would be appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ekarim2020
Super User
Super User

Hi @Paul-Prime92 ,

 

The times that are shown appear to be correct. The following formatting examples may help:

 

utcNow('dd/MM/yyyy hh:mm:ss')    ----> 10/08/2022 04:38:56
utcNow('dd/MM/yyyy hh:mm:ss tt') ----> 10/08/2022 04:36:01 PM
utcNow('dd/MM/yyyy HH:mm:ss')    ----> 10/08/2022 16:36:30
 

Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
ekarim2020
Super User
Super User

Hi @Paul-Prime92 ,

 

The times that are shown appear to be correct. The following formatting examples may help:

 

utcNow('dd/MM/yyyy hh:mm:ss')    ----> 10/08/2022 04:38:56
utcNow('dd/MM/yyyy hh:mm:ss tt') ----> 10/08/2022 04:36:01 PM
utcNow('dd/MM/yyyy HH:mm:ss')    ----> 10/08/2022 16:36:30
 

Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.
Paul-Prime92
New Member

@ekarim2020 Hey, sorry for the long response getting back to you it's been a busy one! but thank you for your help, that HH:mm:ss helped sort the issue in no time at all and I've since made a mental note of this formatting for handling future timestamps as I know it'll be popping up a lot. Really appreciate your assistance on this. 

 

Kind Regards,

Paul

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,242)