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

推荐订阅源

V
Vulnerabilities – Threatpost
AI
AI
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
Cisco Talos Blog
Cisco Talos Blog
T
Tenable Blog
L
Lohrmann on Cybersecurity
Know Your Adversary
Know Your Adversary
A
Arctic Wolf
T
Threatpost
AWS News Blog
AWS News Blog
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Cisco Blogs
F
Full Disclosure
Jina AI
Jina AI
Engineering at Meta
Engineering at Meta
I
InfoQ
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
Intezer
C
CERT Recently Published Vulnerability Notes
Last Week in AI
Last Week in AI
P
Privacy International News Feed
Scott Helme
Scott Helme
WordPress大学
WordPress大学
Simon Willison's Weblog
Simon Willison's Weblog
D
Docker
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
Y
Y Combinator Blog
T
Tor Project blog
V
Visual Studio Blog
Spread Privacy
Spread Privacy
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
Google Online Security Blog
Google Online Security Blog
C
Check Point Blog
爱范儿
爱范儿
N
News and Events Feed by Topic
博客园 - 【当耐特】
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main

博客园 - db's jim

NuGet 无法连接到远程服务器-解决方法(转) 未能解析此远程名称:’nuget.org’ 解决方法(转) [转]jquery对事件冒泡的处理方法 Asp.net中的认证与授权 JS的事件监听机制 用映射的方法获取当前方法的名称 log4net的各种Appender配置示例(转) System.Diagnostics命名空间里的Debug类和Trace类的用途(收藏) Failed to execute request because the App-Domain could not be created C#Windows服务程序安装 VS2010快捷键 生成方法存根 (Stub) NHibernate 事务查询的更新事件 Nhibernate.hbm2ddl.auto配置详解 NHibernate.Tool.hbm2ddl SchemaExport SQL2005 开窗函数 通过WEB方式修改windows帐号的秘密 将EXCEL文档导入SQL server 2005错误 castle ActiveRecord 初始化
Newtonsoft.Json处理日期问题
db's jim · 2012-05-06 · via 博客园 - db's jim

 用Newtonsoft.Json转换json,可是如果数据库是日期类型转换出来之后变成了"\/Date(1269582661683+0800)\/"这样的格式

   下面是解决方案:

        List<UserInfo> listUser = UserInfoManage.GetUserInfoBySQL("Select Top 5 * From Userinfo");
        IsoDateTimeConverter timeConverter = new IsoDateTimeConverter();
        //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式     
        timeConverter.DateTimeFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss";
        //listUser是准备转换的对象
        string ResJsonStr = JsonConvert.SerializeObject(listUser, Formatting.Indented, timeConverter);
        return ResJsonStr;