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.
Solved! Go to Solution.
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.
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.
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.
I use Azure SQL DB. I set the database datefield datatype to datetimeoffset. Powerapps handles the timezone offset perfectly.
User | Count |
---|---|
165 | |
90 | |
72 | |
64 | |
62 |
User | Count |
---|---|
210 | |
152 | |
96 | |
86 | |
66 |