易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql数据Unix时间戳与C# DateTime时间类型互换

Unix时间戳最小单位是秒,开始时间为格林威治标准时间1970-01-01 00:00:00
ConvertIntDateTime方法的基本思路是通过获取本地时区表示Unixk开始时间,加上Unix时间值(即过去的秒数).
ConvertDateTimeInt方法的基本思路是通过刻度数差,再把刻度数转换为秒数,当然要说明的是,我这里返回的是double类型,意义上并非是真正的Unix时间戳格式。
要获取真正Unix时间戳的,只获取整数部分就可以了。
dangranusing System;
using System.Collections.Generic;
using System.Text;
namespace WWFramework.DateTimes
{
    /// <summary>
    /// 时间相关函数
    /// </summary>
    public static class Function
    {
        /// <summary>
        /// 将Unix时间戳转换为DateTime类型时间
        /// </summary>
        /// <param name="d">double 型数字</param>
        /// <returns>DateTime</returns>
        public static System.DateTime ConvertIntDateTime(double d)
        {
             System.DateTime time = System.DateTime.MinValue;
             System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
             time = startTime.AddSeconds(d);
            return time;
         }
        /// <summary>
        /// 将c# DateTime时间格式转换为Unix时间戳格式
  &nb


相关文档:

解决mysql中文乱码问题

1、打开文本编辑my.cnf
sudo gedit /etc/mysql/my.cnf
在[client]
节点,添加
default-character-set=utf8 (客户端缺省以utf8存储)
在[mysqld]
节点,添加
default-character-set=utf8  (数据库缺省以utf8存储)
init_connect='SET NAMES utf8'
(设定连接mysql数据库时使用utf8编码,以让mysql数据库为utf8 ......

如何修改SQLPLUS提示符和mysql提示符

作者 小荷||【转载时请务必以超链接形式标明文章原始出处和作者信息】
· 永久链接: http://www.oracleblog.cn/useful-script/prompt-of-sqlplus/
misc@ORALOCAL(192.168.0.49)>
如果你也想和我一样,在sqlplus登录数据库的时候,能提示不少像上面这样详细登录的信息:
1.登录的用户名。当你的数据库中有多个 ......

VB.NET/C# and JavaScript communication

Introduction
This article is about passing data between VB.NET/C# WinForms and JavaScript.
Before reading further, let me warn you that this article is not about ASP.NET. Concepts covered in the article are applied to Desktop applications.
Background
I was working on a project which required dat ......

删除MYSQl BIN LOG 日志

1.查看档案
mysql> show binary logs;
+----------------+-----------+
| Log_name | File_size |
+----------------+-----------+
| ablelee.000001 | 150462942 |
| ablelee.000002 | 125 |
| ablelee.000003 | 106 |
+----------------+-----------+
2.删除bin-log(删除ablelee.000003之前的而没有包含ablel ......

如何修改mysql root密码

1、编辑MySQL(和PHP搭配之最佳组合)配置文件:
windows环境中:%MySQL(和PHP搭配之最佳组合)_installdir%\my.ini //一般在MySQL(和PHP搭配之最佳组合)安装目录下有my.ini即MySQL(和PHP搭配之最佳组合)的配置文件。
linux环境中:/etc/my.cnf
在[MySQL(和PHP搭配之最佳组合)d]配置段添加如下一行:
skip-grant-tables
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号