惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
月光博客
月光博客
V
Visual Studio Blog
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
Jina AI
Jina AI
J
Java Code Geeks
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
Recorded Future
Recorded Future
C
Check Point Blog
腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
Hacker News: Ask HN
Hacker News: Ask HN
SecWiki News
SecWiki News
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News | PayPal Newsroom
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cloudbric
Cloudbric
F
Full Disclosure
The Cloudflare Blog
Y
Y Combinator Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
S
Schneier on Security
Schneier on Security
Schneier on Security
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
AI
AI
N
News and Events Feed by Topic
T
Tor Project blog
P
Palo Alto Networks Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog

博客园 - Lance Yang

批量插入Oracle,遇到CLob字段慢的解决办法 c#,利用WPF的ScaleTransform和TranslateTransform实现图片的缩放效果 自定义控件如何给特殊类型的属性添加默认值 z(转) Oracle 12c心得 Entity Framework Code First (八)迁移 Migrations EF Code First学习笔记 C#判断程序是由Windows服务启动还是用户启动 全方位掌握 NSIS 的操作 NSIS学习笔记(转) C#开源框架(整理) 十大前端开发框架(转) .Net 学习 C# 实现无焦点窗体(转载) C#调用C++导出类(转) Socket异步发送的同步控制 自己编码实现数据库的映射实体的代码生成器 C# P/Invoke中传递数组参数 Digital image processing In C# C#数字图像处理(摘录)
C++C#时间转换
Lance Yang · 2014-10-24 · via 博客园 - Lance Yang

time_t是从1970年1月1日的格林尼治时间开始的,所以以下就是你要的结果
System.DateTime time= new System.DateTime(1970, 1, 1).ToLocalTime().AddSeconds(1199351662);

class Program
{
static void Main(string[] args)
{
// 你得到的数字是自格林尼治时间(UTC) 1970 年 1 月 1 日午夜 12:00:00 起的秒数
// 相当于本地时间即北京时间(Local) 1970 年 1 月 1 日上午 8:00:00 起的秒数
double nMinute = 1199351662;

// 得到 1970 年 1 月 1 日午夜 12:00:00, 但其只读属性 Kind 值为 Unspecified,表示它代表了一个未定义时区的时间。
DateTime when = new DateTime(1970, 1, 1);

// 把 Unspecified 时间转换为本地时间。
// 按北京时间会增加8小时
when = when.ToLocalTime();

// 加上时间偏移量,参数单位为秒
when = when.AddSeconds(nMinute);

Console.WriteLine(when);
}
}