javascript - PHP dates and timezones -


i have admin panel items entered have time_posted , expiration time. these times use timestamp (time()) upon being entered.

i want entering of expiration time use fancy date/time selector, selector uses javascript client time rather server time.

a way fix save timezone user in, use offset data entered, it's has 100% correct.

is there 'proper' way approach this? saw php functions use timezone setting others not, instance actual time() function doesn't , if create datetime object, output current timestamp, change timezone , output timestamp again returns same timestamp twice.

any pointers lovely

i assume actual timestamp value still correct (independent) regardless of settings/timezone end user has.

problems may apper when/if want generate date strings server-side , return times offsets.

either 1. dont generate date strings server side, if not sure timezone offsets or 2. warn users , make sure specify timezone , force timezone whenever output date string timestamps


Comments