在线时间戳和标准时间转换工具

Swift
NSDate().timeIntervalSince1970
Go
import (
  "time"
)
int64(time.Now().Unix())
Java
// pure java
System.currentTimeMillis() / 1000
// joda java
DateTime.now().getMillis() / 1000
// java >= 8
Instant.now().getEpochSecond()
JavaScript
Math.round(new Date() / 1000)
Objective-C
[[NSDate date] timeIntervalSince1970]
MySQL
SELECT unix_timestamp(now())
SQLite
SELECT strftime('%s', 'now')
Erlang
calendar:datetime_to_gregorian_seconds(calendar:universal_time())-719528*24*3600.
PHP
<?php
// pure php
time();
<?php
// carbon php
use Carbon\Carbon;
Carbon::now()->timestamp;
Python
import time
time.time()
import arrow
arrow.utcnow().timestamp
Ruby
Time.now.to_i
Shell
date +%s
Groovy
(new Date().time / 1000).longValue()
Lua
os.time()
.NET/C#
DateTimeOffset.UtcNow.ToUnixTimeSeconds();
Dart
(new DateTime.now().millisecondsSinceEpoch / 1000).truncate()
阿里云特惠优惠券入口


腾讯云精选优惠券入口


华为云产品特惠活动入口


恒创科技-海外免备案高防服务器特惠
x