Unix时间戳(Unix timestamp)转换工具
Unix时间戳(Unix timestamp) 北京时间
北京时间 年 月 日 时 分 秒 Unix时间戳
| 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 | 先 import time 然后 time.time() |
| Ruby | 获取Unix时间戳:Time.now 或 Time.new 显示Unix时间戳:Time.now.to_i |
| 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" |
| Java | String date = new java.text.SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new java.util.Date(Unix timestamp * 1000)) |
| JavaScript | 先 var unixTimestamp = new Date(Unix timestamp * 1000) 然后commonTime = unixTimestamp.toLocaleString() |
| Linux | date -d @Unix timestamp |
| MySQL | from_unixtime(Unix timestamp) |
| Perl | 先 my $time = Unix timestamp 然后 my ($sec, $min, $hour, $day, $month, $year) = (localtime($time))[0,1,2,3,4,5,6] |
| PHP | date('r', Unix timestamp) |
| PostgreSQL | SELECT TIMESTAMP WITH TIME ZONE 'epoch' + Unix timestamp) * INTERVAL '1 second'; |
| Python | 先 import time 然后 time.gmtime(Unix timestamp) |
| Ruby | Time.at(Unix timestamp) |
| SQL Server | DATEADD(s, Unix timestamp, '1970-01-01 00:00:00') |
| VBScript / ASP | DateAdd("s", Unix timestamp, "01/01/1970 00:00:00") |
| 其他操作系统 (如果Perl被安装在系统中) |
命令行状态:perl -e "print scalar(localtime(Unix timestamp))" |
| Java | long epoch = new java.text.SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse("01/01/1970 01:00:00"); |
| JavaScript | var commonTime = new Date(Date.UTC(year, month - 1, day, hour,minute, second)) |
| MySQL | SELECT unix_timestamp(time) 时间格式: YYYY-MM-DD HH:MM:SS 或 YYMMDD 或 YYYYMMDD |
| Perl | 先 use Time::Local 然后 my $time = timelocal($sec, $min, $hour, $day, $month, $year); |
| PHP | mktime(hour, minute, second, month, day, year) |
| PostgreSQL | SELECT extract(epoch FROM date('YYYY-MM-DD HH:MM:SS')); |
| Python | 先 import time 然后 int(time.mktime(time.strptime('YYYY-MM-DD HH:MM:SS', '%Y-%m-%d %H:%M:%S'))) |
| Ruby | Time.local(year, month, day, hour, minute, second) |
| SQL Server | SELECT DATEDIFF(s, '1970-01-01 00:00:00', time) |
| Unix / Linux | date +%s -d"Jan 1, 1970 00:00:01" |
| VBScript / ASP | DateDiff("s", "01/01/1970 00:00:00", time) |
Unix时间戳(Unix timestamp)转换工具的更多相关文章
- Unix时间戳(Unix timestamp)转换
http://tool.chinaz.com/Tools/unixtime.aspx 如何在不同编程语言中获取现在的Unix时间戳(Unix timestamp)? Java time JavaScr ...
- js 取得 Unix时间戳(Unix timestamp)
js 取得 Unix时间戳 Unix时间戳(Unix timestamp),或称Unix时间(Unix time).POSIX时间(POSIX time),是一种时间表示方式,定义为从格林威治时间19 ...
- 如何在不同编程语言中获取现在的Unix时间戳(Unix timestamp)
Java time JavaScript Math.round(new Date().getTime()/1000)getTime()返回数值的单位是毫秒 Microsoft .NET / C# ep ...
- 如何在不同编程语言中获取现在的Unix时间戳(Unix timestamp)?
Java time JavaScript Math.round(new Date().getTime()/1000) 之所以除以1000是因为getTime()返回数值的单位是毫秒 Microsoft ...
- [转]js 取得 Unix时间戳(Unix timestamp)
本文转自:https://blog.csdn.net/o0snow/article/details/6858829 js 取得 Unix时间戳 Unix时间戳(Unix timestamp),或称Un ...
- 现在的Unix时间戳(Unix timestamp)
如何在不同编程语言中获取现在的Unix时间戳(Unix timestamp)? Java time JavaScript Math.round(new Date().getTime()/1000)ge ...
- MySql 格式化时间(包括正常时间格式与unix时间戳的互相转换)
函数:FROM_UNIXTIME 作用:将MYSQL中以INT(11)存储的时间以"YYYY-MM-DD"格式来显示.语法:FROM_UNIXTIME(unix_timestamp ...
- c# datetime与 timeStamp(unix时间戳) 互相转换
/// <summary> /// Unix时间戳转为C#格式时间 /// </summary> /// <param name="timeStamp" ...
- unix时间戳(unix timestamp)与北京时间的互转方法
1.在linux bash下北京时间与unix时间戳互转: 获取unix timestamp: 命令:date "+%s" 输出:1372654714 获取北京时间: 命令:dat ...
随机推荐
- -- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.
[root@DB ~]# mysqldump -uroot -p123 --flush-logs --all-databases >fullbackup_sunday_11_PM.sql -- ...
- iptables 开启80端口
[root@v01-svn-test-server online]# iptables -F#清空规则 [root@v01-svn-test-server online]# iptables -L# ...
- sql:除非另外还指定了 TOP 或 FOR XML,否则,ORDER BY 子句在视图、内联函数、派生表、子查询
执行sql语句: select * from ( select * from tab where ID>20 order by userID desc ) as a order by date ...
- 利用SQLiteOpenHelper来管理SQLite数据库 (转)
转载自 利用SQLiteOpenHelper来管理SQLite数据库 http://blog.csdn.net/conowen/article/details/7306545 Android学习笔记( ...
- IOS杂谈
1 IOS名称是iPhone Operating System 的缩写,原本这个系统名为iPhone OS,意思是iPhone 操作系统. 2 IOS的开发环境是Xcode.Xcode就成为了iPho ...
- uva 10246(最短路变形)
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=28972 思路:spfa求出每个点到其余顶点的最短路(最短路上的每个 ...
- 在js里面使用php语言
- Knowledgeroot安装与使用入门
采用 PHP 开发的知识库系统,基于树状结构对内容进行组织.使用 FCKEditor 进行内容编辑. 效果http://demo.knowledgeroot.org/index.php?id=2230 ...
- SPEL语言-Spring Expression Language
Spring表达式语言全称为"Spring Expression Language",缩写为"SpEL",类似于Struts 2x中使用的OGNL表达式语言,能 ...
- parseFloat
parseFloat会把输入完整的数进行比较,不会比较中间数字.