Announcement

Collapse
No announcement yet.

Time location

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Time location

    Hello everyone, I have problems to recover the correct time in the country.
    Use this code:

    $date=new DateTime(); //this returns the current date time
    $result = $date->format('YmdHis');

    setlocale (LC_TIME, "it_IT");
    $data = strftime('%Y%m%d-%h%M');
    echo $data;
    $data1 = date(" - Y-m-d H:i:s");
    echo $data1;
    The time is always 4 hours behind.
    What can I check?
    Thanks.

  • #2
    The time is retrieved from your server. I guess that that time is not correct.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Check your php.ini for the default time zone or use date_default_timezone_set (see http://php.net/manual/en/function.da...mezone-set.php)

      Comment

      Working...
      X