Skip to content

Instantly share code, notes, and snippets.

@c80609a
Created October 14, 2020 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save c80609a/59c8d4579b5827d11e2c0bc14c862648 to your computer and use it in GitHub Desktop.
Save c80609a/59c8d4579b5827d11e2c0bc14c862648 to your computer and use it in GitHub Desktop.
WTF DateTime.current
```
ubuntu@server:~$ timedatectl
Local time: Wed 2020-10-14 20:03:02 MSK
Universal time: Wed 2020-10-14 17:03:02 UTC
RTC time: Wed 2020-10-14 17:03:03
Time zone: Europe/Moscow (MSK, +0300)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
```
```
ubuntu@server:~/project/current$ bundle exec rails c -e production
Loading production environment (Rails 6.0.1)
irb(main):001:0> DateTime.current
=> Wed, 14 Oct 2020 17:04:56 +0000
irb(main):002:0>
```
@c80609a
Copy link
Author

c80609a commented Oct 14, 2020

solved, application.rb:

    config.active_record.default_timezone = :local
    config.time_zone = 'Europe/Moscow'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment