cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DAVIDPOWELL
Post Prodigy
Post Prodigy

How to check if DST (Daylight Saving Time) is in effect

Is it possible in powerapps to check and see if DST is in effect on someone's laptop and/or device?

 

If so how can this be modified ?

If(TimeZoneOffset() > 0, "-", "+")
& RoundDown(Abs(TimeZoneOffset()) / 60, 0)
& ":"
& If(Mod(Abs(TimeZoneOffset()), 60) < 10, "0", "")
& Mod(Abs(TimeZoneOffset()), 60)

 

Thanks

Dave

1 ACCEPTED SOLUTION

Accepted Solutions
poweractivate
Super User
Super User

@DAVIDPOWELL 

 

Suppose a Label called Label2

 

In this Label called Label2, for Text property, use only part of your original formula like this:

 

 

If(TimeZoneOffset() > 0, "-", "+")
& RoundDown(Abs(TimeZoneOffset()) / 60, 0)

 

 

Suppose another Label called Label3

 

In this Label called Label3, for Text property, use a formula like this:

 

 

If(Value(Label2.Text) = -7,"MST",If(Value(Label2.Text) = -6,"MDT","Other"))

 

 

Now, you can temporarily change the Text property of Label2 to simulate expected values.

Change Text property of Label2 to -8. Label3 text should now say Other

Change Text property of Label2 to -7. Label3 text should now say MST

Change Text property of Label2 to -6. Label3 text should now say MDT

 

Now, change Text property of Label2 back to the correct real formula:

 

 

If(TimeZoneOffset() > 0, "-", "+")
& RoundDown(Abs(TimeZoneOffset()) / 60, 0)

 

 

Check if something like the above helps you.

View solution in original post

1 REPLY 1
poweractivate
Super User
Super User

@DAVIDPOWELL 

 

Suppose a Label called Label2

 

In this Label called Label2, for Text property, use only part of your original formula like this:

 

 

If(TimeZoneOffset() > 0, "-", "+")
& RoundDown(Abs(TimeZoneOffset()) / 60, 0)

 

 

Suppose another Label called Label3

 

In this Label called Label3, for Text property, use a formula like this:

 

 

If(Value(Label2.Text) = -7,"MST",If(Value(Label2.Text) = -6,"MDT","Other"))

 

 

Now, you can temporarily change the Text property of Label2 to simulate expected values.

Change Text property of Label2 to -8. Label3 text should now say Other

Change Text property of Label2 to -7. Label3 text should now say MST

Change Text property of Label2 to -6. Label3 text should now say MDT

 

Now, change Text property of Label2 back to the correct real formula:

 

 

If(TimeZoneOffset() > 0, "-", "+")
& RoundDown(Abs(TimeZoneOffset()) / 60, 0)

 

 

Check if something like the above helps you.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,499)