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

推荐订阅源

Latest news
Latest news
Cisco Talos Blog
Cisco Talos Blog
Simon Willison's Weblog
Simon Willison's Weblog
N
News and Events Feed by Topic
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
Security Affairs
PCI Perspectives
PCI Perspectives
I
Intezer
V2EX - 技术
V2EX - 技术
S
Securelist
O
OpenAI News
S
Secure Thoughts
aimingoo的专栏
aimingoo的专栏
V
Visual Studio Blog
P
Proofpoint News Feed
月光博客
月光博客
博客园 - 叶小钗
Hacker News: Ask HN
Hacker News: Ask HN
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Stack Overflow Blog
Stack Overflow Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Google DeepMind News
Google DeepMind News
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Schneier on Security
Schneier on Security
N
News | PayPal Newsroom
S
Schneier on Security
T
Threatpost
G
Google Developers Blog
P
Palo Alto Networks Blog
P
Privacy & Cybersecurity Law Blog
Microsoft Azure Blog
Microsoft Azure Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
Cyber Attacks, Cyber Crime and Cyber Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Privacy International News Feed
博客园 - 三生石上(FineUI控件)
Help Net Security
Help Net Security
Google Online Security Blog
Google Online Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
D
DataBreaches.Net
Cyberwarzone
Cyberwarzone
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Webroot Blog
Webroot Blog
K
Kaspersky official blog
Security Latest
Security Latest
www.infosecurity-magazine.com
www.infosecurity-magazine.com

博客园 - SuperCai

Leaf'n Joy 隐私政策 Leaf'n Joy (植物灯IOSAPP) WndProc(ref Message m) [转]DllImport属性详解 [转]C#自定义控件背景色透明的方法 对C#插件接口应用的一些理解 [转]使用foreach 循环删除DataRow的时候的问题 UTC时间与WINDOWS时间互换 [转]C# Telnet [原]电子工程师工具箱 动态内存中加载DLL的问题 电缆电压降计算 红外对射探测器的安装方法 红外对射调试 终于想起了密码~~汗~~ 解决 Win2003 SP1 无法安装 - SuperCai .net创建windows Service步骤 用netsh自动切换IP
日期时间格式化(到毫秒)
SuperCai · 2011-12-13 · via 博客园 - SuperCai
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;

public class MyClass
{
public static void RunSnippet()
{
DateTime thisDate = DateTime.Now;
DateTime utcDate = thisDate.ToUniversalTime();
//DateTime unspecifiedDate = new DateTime(2000, 3, 20, 13, 2, 3, 0, DateTimeKind.Unspecified);
DateTime unspecifiedDate = DateTime.Now;
CultureInfo ci;
string msgCulture = "Culture:";
string msgRoundtripUnspecified = "(o) Roundtrip (Unspecified):. ";

ci = Thread.CurrentThread.CurrentCulture;
Console.WriteLine("{0,-30}{1}\n", msgCulture, ci.DisplayName);
Console.WriteLine(msgRoundtripUnspecified + unspecifiedDate.ToString("o", ci));
String format="yyyyMMdd hh:mm:ss ffff";
DateTime date=DateTime.Now;
Console.WriteLine(unspecifiedDate.ToString(format, DateTimeFormatInfo.InvariantInfo));
}

#region Helper methods

public static void Main()
{
try
{
RunSnippet();
}
catch (Exception e)
{
string error = string.Format("---\nThe following error occurred while executing the snippet:\n{0}\n---", e.ToString());
Console.WriteLine(error);
}
finally
{
Console.Write("Press any key to continue...");
Console.ReadKey();
}
}

private static void WL(object text, params object[] args)
{
Console.WriteLine(text.ToString(), args);
}

private static void RL()
{
Console.ReadLine();
}

private static void Break()
{
System.Diagnostics.Debugger.Break();
}

#endregion
}