how to obtain same date result on diferent servers


//                            viper-7            phpfiddle
fdate(1346976000);       // Fri 2012-09-07     Thu 2012-09-06
fdate(1348704000);       // Thu 2012-09-27     Wed 2012-09-26
fdate(time());           // see yourself

function fDate($what){echo date('D Y-m-d',$what).'<br>';}


test links

What do I need to set up in order to have the same results on any server? Thanks

I am sure is a matter of time zone, but I do not know how to be aware of this.


Set the default timezone

Set it to UTC or GMT and you can use it as a basis for all your servers


fdate(time());  // will return the UTC time

use gmdate to return gmt time

function fDate($what){echo gmdate('D Y-m-d',$what).'<br>';}

see if you still have issues.

Include date_default_timezone_set at the beginning of your script based on your desired timezone.


List of Supported Timezones

Need Your Help

JDBC error after application runs for a while

java jdbc jruby

MySQL Connector/J (version 5.1.6) gets me the following error after a few minutes of opening and closing connections every second):

Checkbox is always coming as unchecked

jquery kendo-ui kendo-grid telerik-mvc

I have following Kendo Grid ans associated jQuery. On a button click, I need to know whether checkbox is checked. But at present it is showing 'false' always. How can we correct it?