I was wondering if someone could give me some advice on php /mysql with regards to time. Basically I want to enter the Unix Timestamp from the server into a field in my database. Should I use a php function to get the timestamp store it in a variable and then write that variable into an long integer column in a table? Also I will want to be using the timestamp when i extract data e.g. Only show records records whose "end date " timestamp is > than the existing timestamp. Is this possible am I going the right way about it? Also I presume I can do some arithmetic with timestamps? I.e add a weekd ? by adding (60X60 X24 x 7) seconds to the existing timestamp?
Also just checking, I can convert a unix timestamp into a date + time using a php function?
Am I approaching this in the right direction? I am new to working with time. XD, normally I would just use the SQL Now() function, but I don't think this is suitable, or are there more suitable sql methods?
Finally, I presume unix timestamps are based upon the servers time? if I set locale to UK, but run scripts of a USA server, will I have to adjust my timestamps to account for -5 hours? -1 X(60X60X5) ?
Thankyou for your help!
EDIT: if i use the date_default_timezone_set() function to change timezones, will i get the correct times / dates returned? e.g. if server is in usa, change the timezone set, to usa for calculations but output it with a different timezeone_set parameter? Will this work instead of manually offsetting?