piap.excel 微软 时间戳转换mssql sql server文件时间戳转换unix 导入mysql





需要不个mssql的sql文件导入mysql.他们的时间戳格式不同..ms用的是自定义的时间戳

excel时间戳跟mssql的一样,ms系列的都是中个阿..



 作者Attilax 艾龙, EMAIL:1466519819@qq.com

来源:attilax的专栏

地址:http://blog.csdn.net/attilax





////////////unix时间戳,是从1970开始.而ms的时间戳格式从1900年开始...

此外,mssql的时间不是1000ms级的,每300ms计算一次..



//////ms的时间戳格式下列的:

INSERT [dbo].[a0moneyx] ([id], [acc], [datex], [moneyx], [cls], [demo]) VALUES (696, N'alip', CAST(0x0000A1EA00E297D0 AS DateTime), CAST(19.00 AS Numeric(18, 2)), N'ea', N'支付-漂白粉去色剂漂白剂漂白水去黄剂消毒剂衣物去黄增白去串色氧净剂')



//////////////

 $msDate="0x0000A1EA00E297D0";

$unixTimstmp = convertToUnixTimeStamp_frmMssql($msDate);

 

echo "time:" . $date = date_yymmddHHmmss($unixTimstmp);

 

 function convertToUnixTimeStamp_frmMssql($timestmp_mssql)

{

    $date_s = substr($timestmp_mssql, 0, 10);

    $date_tmstmp_ms = hexdec($date_s);

    $unixTimeStamp_dateONly = ($date_tmstmp_ms - 17 - 70 * 365) * 86400; //-8*3600;



    $time_s = substr($timestmp_mssql, 10);

    $time_tmstmp_ms = hexdec($time_s);

    $time_tmstmp = $time_tmstmp_ms / 300;



    $tmstmp = $unixTimeStamp_dateONly + $time_tmstmp;

    //  $date3=date('Y-m-d H:i:s',$timestmp);

    return $tmstmp;

}



【转】php读取excel文件的日期时间问题_greenxm_百度空间.htm

使用excel转换Unix时间戳_小君羡的blog_新浪博客.htm

Unix时间戳(Unix timestamp)转换工具 - 站长工具.htm

piap.excel 微软 时间戳转换mssql sql server文件时间戳转换unix 导入mysql的更多相关文章

  1. php连接微软MSSQL(sql server)完全攻略

    http://www.jb51.net/article/98364.htm php连接微软MSSQL(sql server)完全攻略 作者:吵吵 字体:[增加 减小] 类型:转载 时间:2016-11 ...

  2. atitit。mssql sql server 转换mysql 及 分页sql ast的搭建

    atitit.mssql sql server 转换mysql  及 分页sql ast的搭建 1. 主要的的转换::函数的转换,分页的转换 1 2. 思路::mssql sql >>as ...

  3. Atitit.数据库新特性战略规划 mssql sql server 2008 SQL2012 SQL2014

    Atitit.数据库新特性 mssql sql server 2008 SQL2012 SQL2014 1. Sql2012 新特性 1 1.1. 增加了Sequence对象. 1 1.2. 新的分页 ...

  4. SQL Server中行列转换 Pivot UnPivot

    SQL Server中行列转换 Pivot UnPivot PIVOT用于将列值旋转为列名(即行转列),在SQL Server 2000可以用聚合函数配合CASE语句实现 PIVOT的一般语法是:PI ...

  5. SQL Server全时区转换

    SQL Server全时区转换 假如你的应用程序是跨国(例如跨国银行交易)使用的话,那么数据库的一些国际化特性支持可以说是非常重要 其中最常见的就是各国时区上的差异,由于SQL Server getd ...

  6. Atitit.mysql oracle with as模式临时表模式 CTE 语句的使用,减少子查询的结构性 mssql sql server..

    Atitit.mysql  oracle with as模式临时表模式 CTE 语句的使用,减少子查询的结构性 mssql sql server.. 1. with ... as (...) 在mys ...

  7. sql server动态行列转换

    原文链接:https://www.cnblogs.com/gaizai/p/3753296.html sql server动态行列转换 一.本文所涉及的内容(Contents) 本文所涉及的内容(Co ...

  8. 将Microsoft SQL Server 2000数据库转换成MySQL数据库

    1. 下载并安装MyODBC.(如果是XP请下载5.3的旧版本,8.x的新版本运行有问题) 2. 创建一个空的MySQL数据库. 3. 在Windows >> 控制面板 >> ...

  9. Sql Server中的数据类型和Mysql中的数据类型的对应关系(转)

    Sql Server中的数据类型和Mysql中的数据类型的对应关系(转):https://blog.csdn.net/lilong329329/article/details/78899477 一.S ...

随机推荐

  1. Spring----->projects----->Spring Security

    1.Spring Security概述 Spring Security是spring社区若干projects中的一个 Spring Security用于为基于spring开发的application提 ...

  2. 用Python玩转词云

    第一步:引入相关的库包: #coding:utf-8 __author__ = 'Administrator' import jieba #分词包 import numpy #numpy计算包 imp ...

  3. 友盟分享SDK集成步骤

    1.官方注册appID. 2.menifest添加和声明umeng相关的activity以及appKey. 3. // 首先声明一个controller变量,由友盟服务工厂类直接取得友盟社交服务. m ...

  4. BHP编译器教程

    BHP编译器教程 BHP是一个WEB模版编程语言编译器,生成PHP后端代码. 最简单的Helloworld例子 编写一个hello.bhp文件 <? $hello="hello,wor ...

  5. POI 读取word (word 2003 和 word 2007) (转)

    最近在给客户做系统的时候,用户提出需求,要能够导入 word 文件,现在 microsoft word 有好几个版本 97.2003.2007的,这三个版本存储数据的格式上都有相当大的差别,而现在 9 ...

  6. Jade之Template Inheritance

    Template inheritance jade支持通过关键字block和extends来实现模板继承. 比如,在layout.jade写上如下代码 html head title My Site ...

  7. 关系型数据库与NOSQL(转)

    出处:http://www.cnblogs.com/chay1227/archive/2013/03/17/2964020.html 关系型数据库把所有的数据都通过行和列的二元表现形式表示出来. 关系 ...

  8. Android性能优化方法(五)

    有时候,我们的页面中可能会包含一些布局,这些布局默认是隐藏的,当用户触发了一定的操作之后,隐藏的布局才会显示出来.比如,我们有一个Activity用来显示好友的列表,当用户点击Menu中的“导入”以后 ...

  9. pictures of you

    http://pan.baidu.com/s/1dEAiwnB 给某人的. I've been looking so long at these pictures of you 我已对着你的照片凝视太 ...

  10. android tcp协议主要函数

    1 tcp_timers: 处理各种timer超时信息,关键函数tcp_xmit_timer 2 tcp_iutput: 3 tcp_output:接收方的接收窗口struct tcpcb.snd_w ...