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


i developing web application. application has different users different countries.

i have used manage thier registrations using utc timestamp. works fine me.

but problem occures when checking expiry date of account.

for example -

suppose registration valid 15 days , user india registration date 11 june 2014 per asia/kolkata timezone, in database table have stored registration date in unix timestamp format (server set utc timezone), on 16th day want expire account , when executing query compairing todays date (date in timestamp, date converted timestamp using strtotime() function of php), found there difference in 1 day. how handle these type of situation? not registration problem other conditions there. if want send email of registration expiry using cron job, how works?

you need few steps.

  • database table of countries along timezone
  • on registration or form submit ip address
  • check details based on ip , country , timezone
  • save country , timezone along record information

in way, can maintain records along creator's timezone.

as far expiring records based on timezone can check based on timezone.

suppose in pakistan , timezone 5+. expiry step should follow timezone.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -