Laravel 5.3 : Setting time zones based on users location
Asked Answered
N

1

3

We have small blog application in Laravel 5.3 in which i need some suggestion about setting time stamps on the following features

1.Admin can able to send notifications to all users with current time stamp (server timezone is Asia/Calcutta) user will see all the notifications based on their time zones.

2.Users can add posts along with their current time stamps , when other users see that posts based on their time zones.

So what are the changes i need to do on the timezone settings in my application??

Nabala answered 6/2, 2017 at 7:39 Comment(0)
V
4

You might have already found an answer to your 7 months old question. Anyway, I am just posting here what I did to get rid of different time zone issue.

First read Timo Huovinen answer.

In my application, user should manually set the timezone. Based on it, convert MySQL time to appropriate timezone before sending it to client.

You can use convert_tz() function to convert between timezones.

Verbiage answered 7/9, 2017 at 18:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.