cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DAVIDPOWELL
Post Prodigy
Post Prodigy

time variable not grabbing hh:mm:ss

I have a textbox(txt_ReOpenedDate) storing a variable called the "TheVar"  being set to 

UpdateContext({TheVar: Now()})    

 

What i need :

When i need that value in txt_ReOpenedDate it is not grabbing the hh:mm:ss  ?

using  i.e. example in a patch formula

 

 opened_at: DateTimeValue(txt_ReOpenedDate.Text),  

 

Thanks

Dave

1 ACCEPTED SOLUTION

Accepted Solutions

@DAVIDPOWELL ,

OK that is interesting as Now() should return the current date/time. I am unsure whether this will do the job as I am a SharePoint user and cannot test it, but try

DateTimeValue(
    Text(
        Now(),
        "[$-en]yyyy-mm-dd hh:mm:ss:fff"
    )
)

 

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.

 

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @DAVIDPOWELL ,

If you just want hh:mm:ss

Text(Now(),"hh:mm:ss")

WarrenBelz_0-1614034595984.png

 

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.

 

warren sorry i need the date also:

2021-02-22 16:19:18.940      for a sql server  field update.

 

The date in  txt_ReOpenedDate    looks like   2/22/2021 4:19 pm

 

when it patches back to sql server it needs to look like  2021-02-22 16:19:18.940

 

I dont think it will like the  "Text"

 

@DAVIDPOWELL ,

OK that is interesting as Now() should return the current date/time. I am unsure whether this will do the job as I am a SharePoint user and cannot test it, but try

DateTimeValue(
    Text(
        Now(),
        "[$-en]yyyy-mm-dd hh:mm:ss:fff"
    )
)

 

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.

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,141)