mysql时间和时间戳转换工具_时间戳转换工具
時(shí)間戳轉(zhuǎn)換工具支持的時(shí)間格式
2021-02-03
2021年2月03日
2021-02-03 09:18:17
2021年2月03日 09:18:17
2021年2月03日 09點(diǎn)18分17秒
只輸入日期時(shí),時(shí)分秒默認(rèn)為00:00:00,例如“2021年2月03日”等同于“2021年2月03日 09:18:17”
不同編程語言獲取時(shí)間戳
Java時(shí)間戳 time
PHP時(shí)間戳 time()
MySQL時(shí)間戳 SELECT unix_timestamp(now())
JS時(shí)間戳 Math.round(new Date().getTime()/1000) getTime() 返回的單位是毫秒
iOS時(shí)間戳 [[NSDate date] timeIntervalSince1970] 小數(shù)部分是毫秒微秒
Python時(shí)間戳 先 import time 然后 time.time()
Ruby時(shí)間戳 獲取Unix時(shí)間戳:Time.now 或 Time.new ,顯示Unix時(shí)間戳:Time.now.to_i
SQL Server時(shí)間戳 SELECT DATEDIFF(s, '1970-01-01 00:00:00', GETUTCDATE())
PostgreSQL時(shí)間戳 SELECT extract(epoch FROM now())
Unix時(shí)間戳/Linux時(shí)間戳 date +%s
Microsoft .NET/C# epoch = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000
VBScript/ASP時(shí)間戳 DateDiff("s", "01/01/1970 00:00:00", Now())
總結(jié)
以上是生活随笔為你收集整理的mysql时间和时间戳转换工具_时间戳转换工具的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: scrapy架构
- 下一篇: 它来了,它来了,船新 MySQL + M