cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TheOpeningBat
Helper III
Helper III

How to set Now() to an India Standard Time irrespective of which time zone the app is been used

Hi,

 

Suppose in the app, I am setting a variable - Set(CurrentDateTime, Now()) - & if the app is been used in any part of the world, what will be the date time displayed? Will it be the local datetime of which region the app is used?

 

Basically my question is - when I am setting the CurrentDateTime variable as above - I want to set it to India Standard Time, irrespective of which time zone the app is been used. 

 

Any pointers would be really helpful.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

There really is no easy way to do that.  But you can easily use TimeZoneOffset(localtime) to adjust any time entered locally to UTC.  Just use 

addMinutes(Now(),TimeZoneOffset(Now()),Minutes)

TimeZoneOffset(Now()) will automatically adjust the time from local to UTC based on whether Now() is in Daylight Savings or not.



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

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

View solution in original post

4 REPLIES 4
Pstork1
Dual Super User
Dual Super User

There really is no easy way to do that.  But you can easily use TimeZoneOffset(localtime) to adjust any time entered locally to UTC.  Just use 

addMinutes(Now(),TimeZoneOffset(Now()),Minutes)

TimeZoneOffset(Now()) will automatically adjust the time from local to UTC based on whether Now() is in Daylight Savings or not.



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

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!
TheOpeningBat
Helper III
Helper III

Hi @Pstork1 - Thanks for your reply.

If I use - Set(CurrentDateTime, DateAdd(Now(), TimeZoneOffset(Now()), Minutes) - Then even if I use the app in say India - It is setting the current time to UTC one & not the India one.

 

Please suggest.

I agree, but that is the point.  There is no way to set the DateTime to a specific timezone.  You can either set it to UTC or local.  This is a way to translate automatically from ANY local time to UTC.  That way you have a known value that you can adjust to locally.



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

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!
mogulman
Impactful Individual
Impactful Individual

I use Azure SQL DB.  I set the database datefield datatype to datetimeoffset. Powerapps handles the timezone offset perfectly.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,183)