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

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
PowerApps Staff Ryanmch
PowerApps Staff

Re: Eastern Time Zone Using Now() Function

If you timestamp your records in UTC, the date/time displayed should reflect the timezone of the user viewing the data. So someone in PST or EST would see the date/time in their respective timezone.

 

To get the UTC timestamp, use the fomula: Text(Now(), UTC)

 

If you store that as text, you will need to use the "DateTimeValue" formula when displaying the value.

 

In the example below, you can see the result.

  1. OnSelect of the button, the formula is "UpdateContext({now: Text(Now(), UTC)})"
  2. The first textbox is just displaying the context I stored previously ("now")
  3. The last textbox uses displays the value stored in "now"; "DateTimeValue(now)"

 

Sample.png

 

 

Ryan McHenry [MSFT - PowerApps]

View solution in original post

PowerApps Staff Ryanmch
PowerApps Staff

Re: Eastern Time Zone Using Now() Function

18 REPLIES 18
TschoofBAH
Level 8

Re: Eastern Time Zone Using Now() Function

https://powerapps.microsoft.com/en-us/tutorials/function-now-today-istoday/

 

"All these functions work in the TimeZone of the current user."

 

_T

TschoofBAH
Level 8

Re: Eastern Time Zone Using Now() Function

Now, if you wanted to change what time is displayed in your app (or used) you could create a variable (not context, you want it to go through different screens) and call it zone. Could then create a collection tz that contains a name and value column. Names would be TimeZones, value would be how many hours ahead or behind your time zone they are. You could then use a dropdown selection to select one of the items in the collection and use that selection value with the DateAdd() function to adjust the time that Now() returns.

Highlighted
dgsonic
Level: Powered On

Re: Eastern Time Zone Using Now() Function

But isn't there an easier way to Increase or Decrease the time. I want to Add/Subtract time from the NOW function to make a time PST, Mountain, Central or Eastern time zone.  Is there a simple function to do that.

 

When i run the Now() function i'm getting AtanticTime on all my timestamps so i want to decrease the time by 4 hours for Pacific Time Zone. How would i timestamp my records using the NOW function and get a PST time when the default is Atlantic Time zone.

 

Derek.

PowerApps Staff Ryanmch
PowerApps Staff

Re: Eastern Time Zone Using Now() Function

If you timestamp your records in UTC, the date/time displayed should reflect the timezone of the user viewing the data. So someone in PST or EST would see the date/time in their respective timezone.

 

To get the UTC timestamp, use the fomula: Text(Now(), UTC)

 

If you store that as text, you will need to use the "DateTimeValue" formula when displaying the value.

 

In the example below, you can see the result.

  1. OnSelect of the button, the formula is "UpdateContext({now: Text(Now(), UTC)})"
  2. The first textbox is just displaying the context I stored previously ("now")
  3. The last textbox uses displays the value stored in "now"; "DateTimeValue(now)"

 

Sample.png

 

 

Ryan McHenry [MSFT - PowerApps]

View solution in original post

PowerApps Staff Ryanmch
PowerApps Staff

Re: Eastern Time Zone Using Now() Function

afernando
Level 10

Re: Eastern Time Zone Using Now() Function

Hi @Ryanmch,

 

I'm trying to write local time to a Date/Time field in an Access custom web app (Azure sql database) and Text(Now(), UTC) doesn't seem to work.

 

I'm based in Melbourne and trying to save UTC+11 time. Text(Now(), UTC) function converts local time to UTC time as expected but also shows UTC time in Access web app and PowerBI instead of the local time. 

 

Therefore I tried using Text(Now(), Local) and it always results in word 'local' instead of the local time. So data won't get written into the field. 

 

Appreciated if you could help resolve this issue. Thanks

TschoofBAH
Level 8

Re: Eastern Time Zone Using Now() Function

Afernando, if you read Raynmch's post above, you will need to use the DateTimeValue() function to reset the Text(Now, UTC) to local time. If you have no use for the UTC time, then just use Text(Now()).

TschoofBAH
Level 8

Re: Eastern Time Zone Using Now() Function

I just re-read your question, this is not an Access Web App forum. This forum is for PowerApps, a different beast.

afernando
Level 10

Re: Eastern Time Zone Using Now() Function

@TschoofBAH

 

I think you don't understand English properly. The root cause of my problem is not AWA but PowerApps. If you don't know the answer to a question please stay away without spamming. 

 

Cheers.

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,581)