在 Eclipse 中查看 Java 应用程序的日期
我一直在尝试向“监视”窗口添加一个 Java 日期对象 (java.util.Date)。有时,当我将鼠标悬停在源编辑器视图中的日期上时,它会以可读格式显示日期值(例如 2009 年 10 月 26 日 14 日...),但有时,它只是不显示日期值,而仅显示声明日期变量/标识符。因此,作为替代方案,以便我可以看到日期值,我尝试将其添加到手表中。
我在手表中看到的是这样的(例如日期标识符是 nowTime)
- x+y? "nowTime" = Date (id=136)
+- cdate= Gregorian$Date (id=139)
|- fastTime = 1256604393000
我想我可以通过将日期设置为日历值并获取日历的组件来添加额外的代码。但这需要更改代码才能调试。这些代码有时没有被删除而使代码变得混乱。还有其他方法可以解决这个问题吗?或者是否有其他我可以使用而无需添加帮助程序调试代码的监视表达式? 有没有
I have been trying to add to the Watch window a Java Date object (java.util.Date). Sometimes, when i hover over a Date in the source editor view, it shows the Date value in a readable format (e.g. 2009 Oct 26 14...) but sometimes, it just does not show the Date value but it only shows the declaration of the date variable/identifier. So as an alternative so that I could see the Date value, I tried adding it to the watch.
What I see in the Watch is something like this (for example the Date identifier is nowTime)
- x+y? "nowTime" = Date (id=136)
+- cdate= Gregorian$Date (id=139)
|- fastTime = 1256604393000
I am thinking that I could extra code by setting the Date as Calendar value and getting the component of the Calendar. But this requires code change just to Debug. This codes are sometimes not deleted and makes the code messy. Is there any other way to fix this? Or are there other watch expression that I could use without adding helper debug codes?
Is there any
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将手表编辑为 nowTime.toString() 以获得可读信息
You could edit the watch to nowTime.toString() to get readable information