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.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Top Kudoed Authors
Users online (1,081)