How to manage timezone for different users of different countries for a php web application?

后端 未结 2 678
情深已故
情深已故 2021-01-24 23:23

I am developing web application. The application has different users from different countries.

I have used to manage thier registrations using UTC timestamp. It works fi

2条回答
  •  [愿得一人]
    2021-01-24 23:58

    You need do few steps.

    • Database table of all countries along their timezone
    • On registration or form submit get IP address
    • Check details based on IP and get Country and Timezone
    • Save country and timezone along record information

    In this way, you can maintain the records along their creator's timezone.

    As far as expiring records based on timezone then you can check based on their timezone.

    Suppose I am in Pakistan and timezone is 5+. So expiry step should also follow my timezone.

提交回复
热议问题