用户操作
[留言]  [发消息]  [加为好友] 
订阅我的博客
XML聚合    FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
Tmstarstone的公告
<center><font style="font-size: 28pt; filter: shadow(color=#0ffff33); width: 100%; color=#ff0000; line-height: 150%; font-family: 方正舒体"><b>好好学习</b><b>天天向上</b></font></center>
文章分类
AAA
Jo Muncher
Kingnare
凡人天下
English
旺旺英语
沪江论坛
JAVA
Java examples (example source code)
Java™ How to Program Fifth Edition
Java开源大全
Java视线论坛
OTHERS
FLASH+UML
SAP/ERP
存档

原创  Date&Time in java codes&XML 收藏

 Date&Time in java codes&XML

 Problem Description
The path of the Time is,
 
Java.util.Date --> XML: datetime --> Java.util.Calendar.getTime()
 
If we have not done any additional change for the Time functions, the result in the end will be many hours away from the actual time.
 
One possible Solution
java.util.Date nowdate=new java.util.Date();    
nowdate.setTime(nowdate.getTime()
-nowdate.getTimezoneOffset()*60*1000);

ps:  getTimezoneOffset():  unit is minute
         setTime() and getTime(): unit is millisecond

Calendar CaseStartDate = srs.getCaseDateInfo().getCaseStartDate();
nowdate
=CaseStarDate.getTime();// Get day and time

发表于 @ 2007年07月29日 17:44:00 | 评论( loading... ) | 编辑| 举报| 收藏

旧一篇:Differences Between sychronous and asychronous processes with WS-BPEL | 新一篇:Auto-Start Programs Config in Windows

  • 发表评论
  • 评论内容:
  •  
Copyright © Tmstarstone
Powered by CSDN Blog