# Timezone not working during Build

**URL:** <https://discuss.circleci.com/t/timezone-not-working-during-build/19244>\
**Category:** Build Environment\
**Created:** [January 9, 2018, 9:12am UTC](https://discuss.circleci.com/t/timezone-not-working-during-build/19244 "2018-01-09T09:12:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![john.ricana](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@john.ricana](https://discuss.circleci.com/u/john.ricana)\
**Post date:** [January 9, 2018, 9:12am UTC](https://discuss.circleci.com/t/timezone-not-working-during-build/19244/1 "2018-01-09T09:12:48Z")

</div>

Hi,

During my build it always fails due to the timezone error below:

php artisan migrate

Warning: date(): It is not safe to rely on the system’s timezone settings. You are _required_ to use the date.timezone setting or the date\_default\_timezone\_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone ‘UTC’ for now, but please set date.timezone to select your timezone. in /home/circleci/project/config/const.php on line 11

Current Timezone use for my application is Asia/Tokyo

Config file used:  
version: 2

jobs:  
build:

```
docker:
  - image: circleci/php:5.6-node-browsers
  - image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: admin
      MYSQL_DATABASE: fellowes
      MYSQL_ROOT_HOST: 127.0.0.1
      TZ: "/usr/share/zoneinfo/Asia/Tokyo" 
environment:
  TZ: "/usr/share/zoneinfo/Asia/Tokyo" 
steps:
  - checkout

  - run: chmod -R 777 ./storage
  - run: mkdir bootstrap/cache

  - run: sudo apt-get update -y
  - run: sudo apt-get install -y libpng-dev libjpeg-dev zip unzip git
  - run: sudo rm -rf /var/lib/apt/lists/*
  - run: sudo docker-php-ext-install zip
  - run: sudo docker-php-ext-configure gd --with-jpeg-dir=/usr/lib/x86_64-linux-gnu/
  - run: sudo docker-php-ext-install pdo pdo_mysql gd mbstring zip
 
  - run: sudo composer self-update
  - restore_cache:
      keys:
        - composer-v1-{{ checksum "composer.json" }}
        - composer-v1-
  - run: composer install -n --prefer-dist
  - save_cache:
      key: composer-v1-{{ checksum "composer.json" }}
      paths:
        - vendor

  - run: cp .env.example .env
  - run: php artisan migrate
  - run: php artisan db:seed

  - run:
      name: Run PhpUnit
      command: ./vendor/bin/phpunit
```

---

<div class="post-metadata">

**Author:** ![john.ricana](https://avatars.discourse-cdn.com/v4/letter/j/6de8d8/32.png) [@john.ricana](https://discuss.circleci.com/u/john.ricana)\
**Post date:** [January 10, 2018, 3:28am UTC](https://discuss.circleci.com/t/timezone-not-working-during-build/19244/2 "2018-01-10T03:28:36Z")

</div>

Any help would really be appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![brandonschabell](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/brandonschabell/32/10215_2.png) [@brandonschabell](https://discuss.circleci.com/u/brandonschabell)\
**Post date:** [January 12, 2018, 2:53am UTC](https://discuss.circleci.com/t/timezone-not-working-during-build/19244/3 "2018-01-12T02:53:23Z")

</div>

Try using just “Asia/Tokyo” for your TZ environmental variables.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:40am UTC](https://discuss.circleci.com/t/timezone-not-working-during-build/19244/4 "2018-06-18T11:40:13Z")

</div>


