Hi all, I have datatime on my database, and it stores the server date time. However the website is targeted for UK users and I want the datetime to be changed for uk time, therefore + 6hrs. how the hell I do this?
thanks for replying I am not coder, I have installed this script.... can you help me how to implement this pls
You shouldn't be asking questions here then .. go and outsource this ( Buy, Sell and Trade section ).
Might work depends on how your adding date/time, open your .htaccess file or create one and add the following line: SetEnv TZ Europe/London Code (markup):
You better use this: ini_set('date.timezone', 'Europe/London'); instead of date_default_timezone_set('Europe/London'); because of this: Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will generate a E_NOTICE if the timezone isn't valid, and/or a E_WARNING message if using the system settings or the TZ environment variable.
Convert your time into seconds and adding extra time in seconds also , when you finish convert again new time into format you want.
you may want to consider just displaying the date or displaying the time as 5 minutes ago or 1 hour ago or 3 days ago, this seems to be the accepted solution for time zones issues when trying to display your date time to users in different time zones