Forum Discussion

hughcjohnson's avatar
hughcjohnson
Frequent Visitor
2 years ago
Solved

DateTimeZone.UtcNow()

Is DateTimeZone.UtcNow() functioning correctly?   When I tested it today (9th April 2024) at 10:47 BST (which is one hour ahead of UTC), it returns "09/04/2024, 10:47:34.439". Surely it should have...
  • johnbasha33's avatar
    2 years ago

    hughcjohnson  

    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 !!