Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
nsaray
Helper II
Helper II

Convert Time to Number

Hi

 

I have a time  field. I want to convert the time to a number like the below

 

22:01pm >22.01

15:00pm > 15.00

9:06am > 9.06

 

Can anyone help

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@nsaray ,

if field is of time type

 

a new column

= format([time], "HH.MM")

 

or

hour([Time]) *100 + minute([Time])

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@nsaray ,

if field is of time type

 

a new column

= format([time], "HH.MM")

 

or

hour([Time]) *100 + minute([Time])

Thank you!

I had to update it to this and it worked, so thanks for the suggestion

(hour([Time]) *100 + minute([Time]))/100

This is the correct answer 

Time.Hour([Duration])+Time.Minute([Duration])/60

 

if you have 01:30:00

previous solution would give you 1.3 hours

my solution gives 1.5 hours

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.