Support the ongoing development of Laravel.io →

ChrisT

Joined 30 Jul 2015

Statistics

Threads 1
Replies 2
Solutions 1
Articles 0

Working with timezones doing complex calculations

I have users across many timezones. Everything in the database is stored in UTC, no problem. What I...

0 Likes
3 Replies
replied 9 years ago

Order By closest to today

How about orderBy(DB::raw('ABS(DATEDIFF(auction.start_date, NOW()))'))-> Add quotes around every...

0 Likes
Solved
replied 9 years ago

Order By closest to today

You can't just insert the SQL, you need to escape it. Something like: orderBy(DB::raw(ABS(DATEDIF...

0 Likes

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.