例如2005-09-29 17:27:18转换成32位的无符号32位整型。
在如何把32位的无符号32位整型转换回来??
验证后马上给分
在如何把32位的无符号32位整型转换回来??
验证后马上给分
解决方案 »
- 关于filestream文件被占用的问题
- 求主窗体向一个公共窗体传值的解决方案
- 读取的Excel放到dataset中的时候有些数据怎么丢失?,
- C#中,赋值与运算的区别--->请看别人写的代码,我不知道为什么要这样写?
- 求助webbrowser控件模拟点击图片热点<area>的 span问题
- 请问字符串"%Aodd%E9"如何 转换成ascii码对应的字符串,在线等(C#)
- 原谅最近穷的没分:有关隐藏桢和Ajax实现无刷新问题?
- C#通过类去访问主窗体控件的问题
- 邪门了 SQL数据库 后台能够编辑 查看 删除 就是不能添加数据
- 急!!!LargeIcon或SmallIcon状态下的ListView如何实现ListViewItem任意移动?及右击任意ListViewItem在其上弹出菜单来?
- 如何判断,本程序那些线程已被创建?
- c#里面如何有效的防止注入呢?
DateTime dt = DateTime.Now;
long l = dt.Ticks;long -> DateTime:
long l = 223456L;
DateTime dt = new DateTime(l);long 是64位有符号整数: System.Int64
long l = 1127938323L;
string s = l.ToString("X");// HexString -> long:
string s = "433af913";
long l = long.Parse(s, System.Globalization.NumberStyles.HexNumber);
{
// Reference DateTime
static readonly DateTime DateTime0 = new DateTime(1900, 1, 1); // DateTime -> UInt32
static UInt32 FromDateTime(DateTime dt)
{
return (UInt32)(dt - DateTime0).TotalSeconds;
} // UInt32 -> DateTime
static DateTime FromUInt32(UInt32 n)
{
return DateTime0.AddSeconds(n);
} // Test
static void Main()
{
DateTime dt0 = DateTime.Now;
UInt32 n = FromDateTime(dt0);
Console.WriteLine(n);
DateTime dt1 = FromUInt32(n);
Console.WriteLine(dt1);
}
}