web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Timer display time on ...
Power Apps
Answered

Timer display time on powerapps and server

(0) ShareShare
ReportReport
Posted on by 220

Hello, I have a timer function in PowerApps. It has a custom API from d365 instance. There is a parameter control in D365 which stops the timer exactly at midnight based on the server timing[GMT timezone] of d365.

Now here is the scenario. When I start the timer[india timezone] say at 9pm , the timer is stopped at 5:30AM [india time] which is 00:00 midnight based on server time.

I want the timer to stop exactly at midnight based on the user's timezone and not server time..

Is it possible to achieve ?

Current behavior : timer started at xx:xx hours- stops at 5:30am[server time]

expected behavior : timer started at xx:xx hours- should stop at 00:00 midnight[based on user timezone ]

function : If(ThisItem.Running = 0, Text(ThisItem.StartDateTime, "[$-en-US]mmm dd yyyy hh:mm:ss") & " - " & Text(ThisItem.EndDateTime, "[$-en-US]mmm dd yyyy hh:mm:ss"),

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,051 Most Valuable Professional on at

    Hi @P_SA ,

    Please look at the TimeZoneOffset function - this should achieve your requirements.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • v-yutliu-msft Profile Picture
    on at

    Hi @P_SA ,

    Do you want to transfer 5:30am to 0:00 midnight?

    If so, I suggest you try DateAdd function to transfer time.

    Since the expected time is earlier then india time 5 and a half hours, you just need to subtract five and a half hours from the current time.

    Try this formula:

    If(ThisItem.Running = 0, Text(DateAdd(ThisItem.StartDateTime,330,Minutes), "[$-en-US]mmm dd yyyy hh:mm:ss") & " - " & Text(DateAdd(ThisItem.EndDateTime,330,Minutes), "[$-en-US]mmm dd yyyy hh:mm:ss")

    Here's a doc about this function for your reference:

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

     

     

    Best regards,

  • P_SA Profile Picture
    220 on at

    Hello @v-yutliu-msft  , Thanks for your reply. I understand what you suggested. But this formula will work only for India .         

    How do I generalize the formula to work with any timezone of the Power App user globally ?

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @P_SA,

    CDS works with UTC time and is saved in UTC at rest. It's suggested to always convert to UTC when your manipulating with dates. Question: I'm not too sure what your scenario is, but since it involves timer and triggering an action, would it be possible to move that logic to Power Automate? There's an out-of-the-box Date Time connector which you can use and convert timezones.

    2020-04-14_19-58-19.png

    Hope this helps

  • Verified answer
    v-yutliu-msft Profile Picture
    on at

    Hi @P_SA ,

    Do you want to transfer time based on time zone dynamics?

    If so, I suggest you try TimeZoneOffset() function, which will return the time difference between local time and UTC time automatically.

    Try this:

    If(ThisItem.Running = 0, Text(DateAdd(ThisItem.StartDateTime,TimeZoneOffset(),Minutes), "[$-en-US]mmm dd yyyy hh:mm:ss") & " - " & Text(DateAdd(ThisItem.EndDateTime,TimeZoneOffset(),Minutes), "[$-en-US]mmm dd yyyy hh:mm:ss")

    Here's a doc about this function:

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

     

     

    Best regards, 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard