cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate I
Advocate I

Eastern Time Zone Using Now() Function

How do i get a Eastern Time using the Now Function.  When we execute the Now function what is the default time zone.  How can i define the time for a particular time zone. Currently i get mm/dd/yyyy  time / am.  

 

Also the time is showing AM and it should be PM for where I'm located.

 

Derek

18 REPLIES 18

"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.

 

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.

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"})

solved using the following function

 

addHours(utcNow(),+2)

 

 

 

Alan

Helper IV
Helper IV

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,

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

Community Champion
Community Champion

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.

 

@Meneghino,

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

 

Community Champion
Community Champion

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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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