toneee
3 years ago

Accessors with Dates?

Posted 3 years ago by toneee

Hi,

I hope I am looking at the right area and not barking up the wrong tree.

Essentially I have two datestamp fields (Date and time, YYYY-MM-DD HH:MM:SS) in my database and I want to work out the difference between the two dates.

From what I have read I can do this with an accessor and then pass the value with the rest of the array to the blade template for a view. Is this correct and how would I accomplish this? I want to get to a point where I can output "You have 2 days, 3 hours and 47 minutes left" message, rather than just outputting the two datestamps if that clears up any confusion or miss explanation.

Hope someone can help & Thanks!

Please sign in or create an account to participate in this conversation.