I want to show the number of days and hours to a date using Carbon , currently I have received the code below.
Carbon
Carbon::parse("2017-03-07 17:46:50")->diffForHumans()
It outputs:
After 6 days
I want it to output something like this:
6 days and after 12 hours
How can i do this?
Sorry, I got this question today, but here it is
$now = Carbon::now(); Carbon::parse("2017-03-07 17:46:50")->diffForHumans($now);
I hope this works and can help others.
Source: https://habr.com/ru/post/1264853/More articles:Does docker work in WSL or connect back to Windows? - dockerReactNative - Webview does not inject JavaScript on Android - androidDynamically load a component in Angular 2 using a selector - angularpointer to a static member function in a structure - c ++Haskell: get a prefix operator that works without parentheses - haskell.NET4 ExpandoObject memory leak usage - .netUsing MdDialogConfig Data on Angular 2 - angularSBT: Is it Wise to Fix Warning for Cutting Library Dependencies - scalaHow is the number of parameters associated with the BatchNormalization level equal to 2048? - kerasCross-entropy calculation in TensorFlow - pythonAll Articles