JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java 新手區  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 日期可以相減嗎?
sakata





發文: 311
積分: 0
於 2010-05-14 16:45 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
請問一下
如果是格式相同的日期
有什麼方法,可以取相差的天數

謝謝


reply to postreply to post
作者 Re:日期可以相減嗎? [Re:sakata]
mumulu





發文: 13
積分: 0
於 2010-05-14 17:06 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
請參閱
http://www.javaworld.com.tw/jute/post/view?bid=29&id=9586&sty=3&age=0&tpg=1&ppg=1#9586

應該沒有可以直接針對格式的日期相減函式吧!


reply to postreply to post
作者 Re:日期可以相減嗎? [Re:sakata]
kentyeh





發文: 644
積分: 6
於 2010-05-14 17:08 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
參考JSR-310這篇的說明,文未有提及Joda Time有實做此規格,否則原始的做法可以考慮從Calendar.getTimeInMillis()取出時間微秒後相減,再回算出差距天數

reply to postreply to post
作者 Re:日期可以相減嗎? [Re:kentyeh]
sakata





發文: 311
積分: 0
於 2010-05-18 14:40 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
感謝

reply to postreply to post
» JWorld@TW »  Java 新手區

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8