Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

matttonks11's avatar

now() returning wrong time

Hi, I've set the timezone and locale values in my config/app.php file so that when I call the now() function it should return the date and correct time for the UK. However it's currently returning

Carbon @1538563125 {#747 ▼
  date: 2018-10-03 10:38:45.893988 +00:00
}

Which is an hour behind the current time. Am I missing something? how do I fix this?

config/app.php file


/*
    |--------------------------------------------------------------------------
    | Application Timezone
    |--------------------------------------------------------------------------
    |
    | Here you may specify the default timezone for your application, which
    | will be used by the PHP date and date-time functions. We have gone
    | ahead and set this to a sensible default for you out of the box.
    |
    */

    'timezone' => 'GMT',

    /*
    |--------------------------------------------------------------------------
    | Application Locale Configuration
    |--------------------------------------------------------------------------
    |
    | The application locale determines the default locale that will be used
    | by the translation service provider. You are free to set this value
    | to any of the locales which will be supported by the application.
    |
    */

    'locale' => 'uk',
0 likes
2 replies
chippy99's avatar
chippy99
Best Answer
Level 5

think it needs to be set to 'timezone' => 'Europe/London',

1 like

Please or to participate in this conversation.