简体   繁体   English

配置灯泡服务器时区的最佳方法是什么(出于API目的)?

[英]What is the best way to configure lamp server's timezone (for API purposes)?

We have a LAMP + Lumen API setup in Ubuntu 14.04 in EC2 US-West Oregon. 我们在EC2美国西部俄勒冈州的Ubuntu 14.04中安装了LAMP + Lumen API。 It is used as an API server. 它用作API服务器。

Server: UTC 服务器: UTC

MySQL configuration is: MySQL的配置是:

mysql> SELECT @@global.time_zone, @@session.time_zone;
+--------------------+---------------------+
| @@global.time_zone | @@session.time_zone |
+--------------------+---------------------+
| +00:00             | +00:00              |
+--------------------+---------------------+

Other test 其他测试

mysql> SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP);
+--------------------------------+
| TIMEDIFF(NOW(), UTC_TIMESTAMP) |
+--------------------------------+
| 00:00:00                       |
+--------------------------------+
1 row in set (0.00 sec)

On my.cnf 在my.cnf上

default_time_zone='+00:00'

Lumen .env configuration 流明.env配置

No information about changing timezones

We want to know if we're doing well and if there are other considerations to modify or use a different configuration. 我们想知道我们是否做得很好,是否还有其他考虑因素需要修改或使用其他配置。

We see this server is not physically in UTC so that's why this came to us. 我们看到此服务器实际上不在UTC中,因此这就是我们要使用它的原因。

Web servers (in fact, most servers) are best configured as UTC, since their clients could be connecting from anywhere in the world. Web服务器(实际上,大多数服务器)最好配置为UTC,因为它们的客户端可以从世界任何地方进行连接。 Choosing a time-zone for the display of web pages is frequently done on a per-user or per-session (using GeoIP lookup) basis. 通常以每个用户或每个会话(使用GeoIP查找)为基础来选择显示网页的时区。 Please edit you're question if there is a specific question you're concerned with. 如果您有特定的问题,请编辑您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM