What is the good way to store future datetime based on date, time & timezone offset. Hello,
I want to store future datetime based on user input date, time & timezone offset on server where timezone is UTC. Pls help.
Thank You.
@krishna8723 store user's timezone in users table, then pass it to Carbon: Carbon::parse($date)->timezone($user->timezone).
Actually i want to publish the post after specific date based on the user input where user can select particular date, time and timezone offset.
User can view the post based on that selected timezone offset. @jlrdw @sti3bas
Yes. But i am having issue on setting up the proper datetime on database based on date, time & timezone offset. @jlrdw
As mentioned, you still store UTC time, but use the offset to get the users timezone.
Did you see the stackoverflow post.
You only need to store what UTC time the post should be published.
So when they say what time to publish, convert it to UTC at that time and store the UTC value.
When, later, you show them what time it will be published, get the UTC time and apply their timezone.
Please sign in or create an account to participate in this conversation.