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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Blog — PlanetScale
Blog — PlanetScale
博客园 - Franky
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
D
Docker
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
N
Netflix TechBlog - Medium
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
H
Help Net Security
B
Blog
宝玉的分享
宝玉的分享

博客园 - 海天一鸥

Windows批处理中的等待技巧 The Ice::Current Object ICE代理的固有方法 C# Tips 2则 Configuring log4net with VS2010 and .Net 4.0 IoC Container Benchmark - Unity, Windsor, StructureMap and Spring.NET Functional .NET 4.0 – Tuples and Zip binary search of an integer array JAVA 上加密算法的实现用例 Exploring The Major Interfaces in Rx 带状疱疹覆灭记 ADO vs ADO.NET vs OLE DB vs ODBC [数据提供程序之间的差别] 获取SYSTEM账户的环境变量 如何在 Windows 7 中使用多线程加快文件复制? 关于VC++ 字符集 C++ reserve 与 resize的区别 ICE bidirectional connections 关键点 你最后会划掉谁的名字…… POCO日志组件Tips
Poco::DateTimeFormatter Tips
海天一鸥 · 2011-04-08 · via 博客园 - 海天一鸥
DateTimeFormatter::format bug?

Postby sgsoft » 25 Oct 2010, 18:07

below code :

Code: Select all
   int tzd=Poco::Timezone::tzd();
   cout<<tzd<<endl;
   Poco::Timestamp now;
        cout<<Poco::DateTimeFormatter::format(now,Poco::DateTimeFormat::SORTABLE_FORMAT)<<endl;   //test1
   cout<<Poco::DateTimeFormatter::format(now,Poco::DateTimeFormat::SORTABLE_FORMAT,tzd)<<endl;  //test2

the test1 is same to test2 ? maybe the tsz parameter has no effect. why?

sgsoft
Posts: 5
Joined: 03 Jul 2010, 12:26

Top


Re: DateTimeFormatter::format bug?

Postby guenter » 27 Oct 2010, 16:22

DateTimeFormatter does not do local time calculation. The optional tzd is only used when the respective format specifier (%z or %Z) is present. To format a proper local time, pass an instance of Poco::LocalDateTime to DateTimeFormatter.