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

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
大猫的无限游戏
大猫的无限游戏
Cyberwarzone
Cyberwarzone
T
Troy Hunt's Blog
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
U
Unit 42
Last Week in AI
Last Week in AI
云风的 BLOG
云风的 BLOG
F
Full Disclosure
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
IT之家
IT之家
Google Online Security Blog
Google Online Security Blog
Cloudbric
Cloudbric
月光博客
月光博客
Hacker News: Ask HN
Hacker News: Ask HN
罗磊的独立博客
N
News and Events Feed by Topic
S
Secure Thoughts
The Last Watchdog
The Last Watchdog
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
Hugging Face - Blog
Hugging Face - Blog
I
Intezer
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 聂微东
P
Privacy International News Feed
有赞技术团队
有赞技术团队
博客园_首页
F
Fortinet All Blogs
Recent Announcements
Recent Announcements
O
OpenAI News
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tor Project blog
B
Blog
量子位
T
Threatpost
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Vulnerabilities – Threatpost
酷 壳 – CoolShell
酷 壳 – CoolShell
S
SegmentFault 最新的问题
L
LangChain Blog

博客园 - 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
}