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

time only no date

hi all,

 

i have an OnSelect pulling the current UTC time on press into a collection example output: (2021-04-16T02:26:59.112Z) 

 

the format as it is needs to stay in the collection for data collection purposes.

 

however, i want to just display the TIME in a textbox.

 

if i put the default to

 

text(readyTime,"hh:mm:ss")

 

it doesn't register.

 

i'm assuming this is because it's not picking up that UTC string as a datetime? 

 

how can i get around this but keeping the datetime string and just extracting the time from it

1 ACCEPTED SOLUTION

Accepted Solutions
RusselThomas
Microsoft
Microsoft

Hi @mrleetyler ,

If it's originally a text type, you should be able to convert it to datetime and then extract the time as text again - The idea would be convert the text to datetime, (which automatically applies a timezone offset), then adjust for timezone offset, then reference the hours, minutes and seconds.

Try this;

 

Text(DateAdd(DateTimeValue(readyTime, "en-US"), TimeZoneOffset(), Minutes), "[$-en-US]hh:mm:ss")

 

Hope this helps,

RT

 

View solution in original post

2 REPLIES 2
RusselThomas
Microsoft
Microsoft

Hi @mrleetyler ,

If it's originally a text type, you should be able to convert it to datetime and then extract the time as text again - The idea would be convert the text to datetime, (which automatically applies a timezone offset), then adjust for timezone offset, then reference the hours, minutes and seconds.

Try this;

 

Text(DateAdd(DateTimeValue(readyTime, "en-US"), TimeZoneOffset(), Minutes), "[$-en-US]hh:mm:ss")

 

Hope this helps,

RT

 

View solution in original post

perfect thanks so much!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,049)