cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iskhj000
Level: Powered On

A common time - UTC

We have projects throghout the US and the one constant is they must report at 5pm the projects local time.

We know for each project and its location and the time zone it must report in (that is stored for our use)
We have local people entering in transactions but also remote people (differnt time zones) helping them entering in transactions into the same project

Regardless if they are remote or local the cutoff time is still based on that projects local timezone

 

Sooooo how do I ignore peoples local time zone and base the transaction totally on UTC (?)  and then from the projects time zone

1 ACCEPTED SOLUTION

Accepted Solutions
iskhj000
Level: Powered On

Re: A common time - UTC

Thank you both.. this worked.  I was then able to convert it to the projects time zone

Switch(selectDRO.Selected.Time_x0020_Zone,
"H",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-10,Hours),
"A",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-8,Hours),
"P",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-8,Hours),
"PD",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-7,Hours),
"M",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-7,Hours),
"MD",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-6,Hours),
"C",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-6,Hours),
"CD",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-5,Hours),
"E",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-5,Hours),
"ED",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-4,Hours))

View solution in original post

3 REPLIES 3
Super User
Super User

Re: A common time - UTC

@iskhj000 

You will want to convert your times to UTC.  You can learn more about it in the documentation here.

But, basically, you can convert to UTC with this formula:

DateAdd( Now(), TimeZoneOffset(), Minutes )

Note: if you are working with a specific date columns, you will want to specify that in the formula (including the TimeZoneOffset function:

DateAdd( yourDateColumn, TimeZoneOffset(yourDateColumn), Minutes )

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Community Support Team
Community Support Team

Re: A common time - UTC

HI @iskhj000 ,

Could you please share a bit more about your scenario?

Do you want to ignore people's local time, and record the cutoff time based on UTC time zone?

 

I agree with @RandyHayes 's thought almost. I think the DateAdd() and TimeZoneOffset() function could achieve your needs.

I have made a test on my side, please take a try with the following formula:

DateAdd( Now(), TimeZoneOffset(), Minutes)     /* <-- Convert current time into UTC format */

If you want to convert a specific Date column value in youe data source into UTC format, please take a try with the following formula:

DateAdd(YourDateColumn, TimeZoneOffset(YourDateColumn), Minutes)

Please check the following article for more details:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff#con...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
iskhj000
Level: Powered On

Re: A common time - UTC

Thank you both.. this worked.  I was then able to convert it to the projects time zone

Switch(selectDRO.Selected.Time_x0020_Zone,
"H",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-10,Hours),
"A",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-8,Hours),
"P",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-8,Hours),
"PD",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-7,Hours),
"M",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-7,Hours),
"MD",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-6,Hours),
"C",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-6,Hours),
"CD",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-5,Hours),
"E",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-5,Hours),
"ED",DateAdd(DateAdd( Now(), TimeZoneOffset(), Minutes),-4,Hours))

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,473)