- SQLite’s datetime functions are all UTC, but they don’t explicitly include the timezone information
- In JavaScript (browsers & Node.js) datetimes without explicit timezone information are interpreted as local time
- In servers (for example, DigitalOcean & GitHub Actions machines) the timezone is usually set to UTC
- In development, the timezone is set to the user’s timezone
- We can change the timezone for the Node.js process in macOS/Linux with the TZ=UTC environment variable
- On Windows, the only solution is to temporarily change the OS timezone
- This sounds too heavy-handed and storing datetimes without an explicit timezone seems like a bad idea, anyway
- So the best solution that works everywhere is to avoid using SQLite datetime functions for generating values that will be stored in the database (it’s still fine to use them for queries)
- To be exact, I’m talking about SQLite’s CURRENT_TIMESTAMP, datetime() and so forth
- The correct way of doing it is using the more generic SQLite datetime function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* Copyright 2015 Google Inc. All rights reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name www.insready.com; | |
root /srv/www/insready.com/public_html; ## <-- Your only path reference. | |
access_log /srv/www/insready.com/logs/access.log; | |
error_log /srv/www/insready.com/logs/error.log; | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} |