网站ip地址查询-ICP备案查询_网站测速_手机号查询

万商数源ip查询,精准ip地址查询_精确ip查询_精准到街道 万商数源网站测速、网站全国测速、节点多、覆盖广、电信网通宽带网站在线测速、国外网站测速 万商数源手机号归属地查询、银行卡归属地、开户行、开户市查询,快速校验
当前位置: 万商数源 > 常用工具
查看网页源代码

UNIX时间戳

生成二维码HTTP状态查询指数查询
现在的Unix时间戳(Unix timestamp)是:
开始
停止
刷新
Unix时间戳(Unix timestamp)
转换
时间(年/月/日 时:分:秒)
转换成Unix时间戳
时间
转换成Unix时间戳
如何在不同编程语言中获取现在的Unix时间戳(Unix timestamp)?
Java time
JavaScript

Math.round(new Date().getTime()/1000)

getTime()返回数值的单位是毫秒

Microsoft .NET / C# epoch = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000
MySQL SELECT unix_timestamp(now())
Perl time
PHP time
PostgreSQL SELECT extract(epoch FROM now())
Python

获取Unix时间戳:Time.now 或 Time.new

显示Unix时间戳:Time.now.to_i

Go 先 import time 然后 int32(time.Now().Unix())
SQL Server SELECT DATEDIFF(s, ‘1970-01-01 00:00:00’, GETUTCDATE())
Unix / Linux date +%s
VBScript / ASP DateDiff(“s”, “01/01/1970 00:00:00”, Now())

其他操作系统

(如果Perl被安装在系统中)

命令行状态:perl -e “print time”
如何在不同编程语言中实现Unix时间戳(Unix timestamp) → 普通时间?
Java time
Microsoft .NET / C# epoch = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000
Linux date -d @Unix timestamp
MySQL SELECT unix_timestamp(now())
Perl time
PHP time
PostgreSQL SELECT extract(epoch FROM now())
Python

获取Unix时间戳:Time.now 或 Time.new

显示Unix时间戳:Time.now.to_i

Ruby 先 import time 然后 time.gmtime(Unix timestamp)
SQL Server SELECT DATEDIFF(s, ‘1970-01-01 00:00:00’, GETUTCDATE())
VBScript / ASP DateDiff(“s”, “01/01/1970 00:00:00”, Now())

其他操作系统

(如果Perl被安装在系统中)

命令行状态:perl -e “print time”
如何在不同编程语言中实现普通时间 → Unix时间戳(Unix timestamp)?
Java time
JavaScript

Math.round(new Date().getTime()/1000)

getTime()返回数值的单位是毫秒

MySQL SELECT unix_timestamp(now())
Perl time
PHP time
PostgreSQL SELECT extract(epoch FROM now())
Python

获取Unix时间戳:Time.now 或 Time.new

显示Unix时间戳:Time.now.to_i

Ruby Time.local(year, month, day, hour, minute, second)
SQL Server SELECT DATEDIFF(s, ‘1970-01-01 00:00:00’, GETUTCDATE())
Unix / Linux date +%s
VBScript / ASP DateDiff(“s”, “01/01/1970 00:00:00”, Now())

意见
反馈

服务热线

400-999-4213

客服微信

客服邮箱

linke@wanshangdata.com