Jump to content

Recommended Posts

Howdy

I am trying to find a way to standardize time of recorded events on my site.  People post questions at different time zones and I want everybody's posting time to be based on a uniform system. And then I need to do some calculations with time (FOR EXAMPLE : 2 hours after posting the person should not be able to edit).  Any idea as how to go about this?

Thanks in advance.

L1

Link to comment
https://forums.phpfreaks.com/topic/158215-ideas-needed-for-time-problem/
Share on other sites

You should just store the datestamp values in your database based off of the server time.  If you need to display these datestamps anywhere on your site you could have a user option of timezone much like forums do which will adjust the date pulled from the database for timezone.

 

As for not being able to edit after 2 hours, you will just need to have the system do a check of the current datestamp vs the stored datestamp and compare the two values to determine the difference.  If the difference is greater than 2 hours then do not allow the function to run.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.