Forum Discussion
DateTimeZone.UtcNow()
- 2 years ago
DateTimeZone.UtcNow() is a function in Power Query that returns the current date and time in Coordinated Universal Time (UTC). It should indeed return the current time in UTC regardless of the time zone of the machine running the query.
In your case, since you tested it on April 9th, 2024, at 10:47 BST (British Summer Time), which is one hour ahead of UTC, you are correct that the UTC time should have been 09:47:34.439, not 10:47:34.439.
It's possible that there might have been some issue with the environment or the Power Query implementation you're using. I'd recommend double-checking the system time settings and ensuring that there are no issues with the Power Query environment.
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
johnbasha33 thanks for the suggestion. The surprising point is that DateTimeZone.UtcNow() is returning the value that I want (BST when it is BST in the UK and GMT when it is not), so I have removed my adjustment code and I get the answer that I want. I am merely wondering why DateTimeZone.UtcNow() is returning BST and not UTC.