当前位置:网站首页>Sequelize配置中的timezone测试
Sequelize配置中的timezone测试
2022-08-09 14:54:00 【好帅的爸爸()】
timezone
该参数表示在存入数据库时,对与SQL中的时间相关的参数做何等的处理。具体如何做处理,除了与参数设置相关外,与当前Sequelize运行的服务器时间也有关系。
区分服务器时间
服务器时间一般是 /etc/localtime指向的时区来确认的。本地演示时,可以通过手动修改时区来设置不同的时间。
示例
服务器时间:北京时间
timezone: “+08:00”
服务器时间:北京时间
timezone: “+00:00”
服务器时间:伦敦时间
timezone: “+08:00”
结论
timezone 设置为『+08:00』可以理解为 数据库的时区时间。在插入时,会比对服务器时间,如果服务器时间为东八区时间,则不做处理。
同理可得 timezone默认值 【+00:00】表示数据库时区时间为UTC时间。如果服务器时间为零时区,则不会做处理。如果服务器时间为北京时间,则会被自动减8。
所以在开发时,需要注意 如果数据库想存储的数据跟你的本地时间一样,则要保证你的服务器时间是本地时间。timezone设置为【+08:00】。
边栏推荐
- Basic principles and common methods of digital image processing
- 【C语言初阶】详解分支语句
- C语言运算符优先级
- What do professional quantitative traders think about quantitative trading?
- bin文档读写
- Simply record offsetof and container_of
- 几何光学简介
- 浅析Servlet三大容器的常用方法及其作用域
- Example of file operations - downloading and merging streaming video files
- How to make your quantitative trading system have probabilistic advantages and positive return expectations?
猜你喜欢
随机推荐
How can I know if quantitative programmatic trading is effective?
怎么才可以知道量化程序化交易是否有效?
记一次解决Mysql:Incorrect string value: ‘\xF0\x9F\x8D\x83\xF0\x9F...‘ for column 插入emoji表情报错问题
自定义指令,实现默认头像和用户上传头像的切换
Left-handed and Right-handed Binary Sorted Trees
Servlet life cycle
Simple analysis of regularization principle (L1 / L2 regularization)
在量化交易过程中,散户可以这样做
Several important functional operations of general two-way circular list
MySql中什么是索引?常用的索引有哪些种类?索引在什么情况下会失效?
量化程序化交易都有哪些热点争议?
Entity Framework Core知识小结
Example of file operations - downloading and merging streaming video files
What is an index in MySql?What kinds of indexes are commonly used?When does an index fail?
Analysis: Which method is used to build a stock quantitative trading database?
怎么用VS+Qt创建新项目
How do quantitative investors obtain real-time market data?
Talking about quantitative trading and programmatic trading
Talking about Shallow Cloning and Deep Cloning of ArraryList
OpenCV简介与搭建使用环境







