cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
TschoofBAH
Level 8

Re: Eastern Time Zone Using Now() Function

"I'm trying to write local time to a Date/Time field in an Access custom web app"

 

In the above sentence, your action "trying to write local time to" is directly related to "Date/Time field in an Access custom web app" which speaks to the people reading that you are attempting this action IN an Access Custom Web app. If you wanted to use proper english and create less ambiguity, you should have stated "to the sql azure database that backs an Access Custom Web app from my powerapps application".

 

I understand english perfectly well. Maybe you should read through the afore messages in this thread before asking a question already answered, as well go over your use of english and make sure it properly conveys what it is you are asking. More specifically, you should reread the part where you need to use DateTimeValue() function to reset the UTC text you set back to the local time of the user.

 

Also, we are trying to help you here, don't be an ass.

 

Cheers.

 

Meneghino
Level 10

Re: Eastern Time Zone Using Now() Function

Hi @afernando and @TschoofBAH

 

Let's keep it professional please, we are all here to help each other and I have seen good posts from both of you.

 

I am a big fan of Access Web Apps, and I see PowerApps (with CDS back-end) as a very worthy successor.  There are a lot of posts from people trying to use PowerApps with AWA as a back end until the initial issues with CDS are sorted out.

 

In reagards to your specific issue @afernando, if you really really want to store the local time to an AWA datetime field then you need store local time as UTC in a PowerApps variable, and then patch that variable to AWA.

 

You can convert the local MyDateVariable (e.g. Now()) to UTC with the same hour minutes senconds with this

DateTimeValue(Text(MyDateVariable, "yyyy-mm-dd")&"T00:00:00.000Z"))


It is taken from this post

 

Please let me know if this helps.

afernando
Level 10

Re: Eastern Time Zone Using Now() Function

Thanks @Meneghino. I got it working using the formula below finally!

 

UpdateContext({LocalTime: Text(DateValue1.SelectedDate ,"[$-en-US]yyyy-mm-dd")&"T" & HourValue1.Selected.Value  &  ":" & MinuteValue1.Selected.Value & ":00.000Z"})

AlanRM
Level: Power Up

Re: Eastern Time Zone Using Now() Function

solved using the following function

 

addHours(utcNow(),+2)

 

 

 

Alan

MK1
Level: Powered On

Re: Eastern Time Zone Using Now() Function

Hi,

In my scenario.

 

My PowerApp Form has a date time column coming form SQL Table.

while a user submitting the form, It will take the date and time of the request created by the user.

But when users from different timezones submit their request. the date column on SQL table is populated based on their timezones.

can we set the date and time column to populate as Eastern timezone for all users on Powerapp Form.

 

There is an approval process once the form is submitted.

Based on this approval process the Date and time column will be updated to the time of approval. can we set this time as one timezone for all users using flow. So that the dateand time column will be updated based on one timezone.

Please let me know your thoughts.

 

Thanks in Advance 

MK

MK1
Level: Powered On

Re: Eastern Time Zone Using Now() Function

@Meneghino,

Hi,

In my scenario.

 

My PowerApp Form has a date time column coming form SQL Table.

while a user submitting the form, It will take the date and time of the request created by the user.

But when users from different timezones submit their request. the date column on SQL table is populated based on their timezones.

can we set the date and time column to populate as Eastern timezone for all users on Powerapp Form.

 

There is an approval process once the form is submitted.

Based on this approval process the Date and time column will be updated to the time of approval. can we set this time as one timezone for all users using flow. So that the dateand time column will be updated based on one timezone.

Please let me know your thoughts.

 

Thanks in Advance 

MK

Meneghino
Level 10

Re: Eastern Time Zone Using Now() Function

Hi @MK1

Always better, in my opinion, to populate SQL columns with UTC and then display the time to the user according to their time zone or the time zone you desire, for example Eastern.

In order to populate the SQL server column with the UTC time of item creation, you can just use a default, there are plenty of hints on that in many SQL forums.

When you update the column, again update it with UTC from Flow.

Hope this helps.

 

MK1
Level: Powered On

Re: Eastern Time Zone Using Now() Function

@Meneghino,

Can you explain in detailhow to do that on App and Flow.

 

Meneghino
Level 10

Re: Eastern Time Zone Using Now() Function

In the app, when patching (using Patch()) or submitting the form just don't supply a value for the datetime column, the SQL Server will supply the corerct default value assuming it is correctly defined as per a number of SQL forum posts.

 

When displaying the datetime, it could be that PowerApps automatically actually displays the info in the user's timezone, but you need to experiment.

 

In MS Flow, there should be a utcnow() function that supplies the correct time stamp.  

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,035)