Tuesday, March 14, 2017

Laravel 5.4 shows diffrent time in xampp and laravel project

Okay am confessing that am having php 5.4 installed, and laravel 5.4 in my code army.Executing same piece of code in laravel project and outside laravel project (ie: simple xampp project) produces very diffrent results.

Here is what i tried

  • timezone is set in php.ini
  • installed latest version of laravel, 5.4
  • googling since 24 hours, without any luck

Test.php (localhost/test/test.php)

    <?php 
    ini_set('date.timezone', 'Asia/Kolkata');
    echo date("Y/m/d h:i:s");
//prints  2017/03/14 01:36:52 
    ?>

Test.blade.php (localhost/blog/public/test)

 @extends('layout')

    @section('content')

    <?php 
    ini_set('date.timezone', 'Asia/Kolkata');
    echo date("Y/m/d h:i:s");
//prints  2017/03/14 07:40:18 
    ?>

    @endsection

Okay i reckon this one is stupid problem, or am being stupid enough, looking forward.



via Synchronized Guy

Advertisement