Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert milliseconds to minutes using luxon library

Tags:

luxon

I want to perform a transformation using luxon from milliseconds to minutes. For eg. if i enter 1000 , te output should be 1m 0s. I am trying Duration.fromMillis(1000).as('minutes') but in return i am getting 0 output. Is there any other way i can achieve the same thing

like image 662
pKay Avatar asked Oct 31 '25 07:10

pKay


1 Answers

Duration.fromMillis(150000).toFormat("mm'm' ss's'")
like image 62
pKay Avatar answered Nov 04 '25 21:11

pKay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!