mardi 30 mai 2017

Show Posts Based on Viewer Timezone in Laravel

I'm working on a site that is scheduled to show tutorials contents to a student at a specific time. I'm using Laravel Framework and Carbon package. I have two fields in the Lessons table. The date/time field and the debut_timezone field to show tutorials to a student based on the scheduled date and time. It's working fine cause I'm using the WHERE clause in Laravel Eloquent.

// For example: 
$lessons = Lesson::where('debut_date', Carbon::now())->get();

How can I use the timezone field so that it will only show tutorial to students based on their timezone. For example, Students on the East Coast can view their lessons 3 hours before students on the West Coast and so on. In this case, when we go global, students in Asia will be able to view their lesson hours before students in the U.S, and so forth.

Please help, please?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2saQTzM
via IFTTT

Aucun commentaire:

Enregistrer un commentaire