Thursday, March 9, 2017

Multiple Timezone related date time calculation in php

My php server is setted to Australia/Sydney

My project is a job site , where users can be from different time zone , and events to work on can be of different timezone . 1> Lets say Booker has registered himself by providing Australia address , so we are assuming his timezone is "Australia/Sydney" , and the Artist whom Booker is making booking request lets say is also from Australia (so same timezone) and the event for which Booker is making the book is also in Australia so same time zone. 2> Now lets say another Booker has registered himself by providing India address , so we are assuming his timezone is "Asia/Calcutta" , and the Artist whom Booker is making booking request lets say is also from Australia (so same Australia/Sydney) and the event for which Booker is making the book is also in Australia so same time zone. 3> Lets say Booker has registered himself by providing Australia address , so we are assuming his timezone is "Australia/Sydney" , and the Artist whom Booker is making booking request lets say is from India ( timezone Asia/Calcutta) and the event for which Booker is making the book is also in India so same time zone.

This are the scenario and I have booking_accept_datetime , booking_request_datetime , event_start_datetime , event_enddatetime

These are the fields I have stored in the database . What else i need to store to make proper work and how I am going to calculate time (keeping in mind the day light savings )for lets say 1> notification to be sent to booker and artist , 2 hours prior to event start

My project is on PHP . I need help on this as I haven't worked on timezone earlier. Thanks in advance.



via Soumik

Advertisement