cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
30rakesh Frequent Visitor
Frequent Visitor

Get Current UTC datetime

Hi,

 

Can anyone please suggest me on how to get the current datetime in UTC. I used function Now() but it is returning the current system local time.

 

Thanks

Rakesh

3 REPLIES 3
SabineOussi Established Member
Established Member

Re: Get Current UTC datetime

Hi rakesh,

 

I am not aware of a way to do it in DAX, but you can do it in M by going to edit queries and adding a custom column with the formula: DateTimeZone.UtcNow()

 

If you still want do it in DAX and use it as a measure, you can get your current timezone by using Now() and adding or substrating hours in order to get UTC time.

 

Hope this helps!

 

Super User
Super User

Re: Get Current UTC datetime

To subtract 1 hour from NOW, you can use a formula like:

 

Column = NOW() - 0.04166666666666667

For 2 hours:

Column = NOW() - 0.04166666666666667*2

etc.

 

 


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

elliotdixon Member
Member

Re: Get Current UTC datetime

Hi @30rakesh I use a slightly different formula to @Greg_Deckler

 

Find your timezone e.g. mine is New Zealand +13hours for summer time.

and use code

 

Date NZTimeZone_NowDateTime = NOW()+(13/24)

unfortunatley I have to remember to change this back after daylight savings time.

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 6 members 2,846 guests
Please welcome our newest community members: