I have two array lists consisting of Calendar objects. I need these two lists to contain the same objects and in the same order - but this isn't the case. I ran the program on debugger mode to check the content of the lists but the object descriptions are gibberish. I just want to know if the year, month and day are the same at each step.
This is what my debugger shows:
When I click the arrow next to each index to reveal more information I still can't find what I need. Is there a way around this? Or perhaps there is another debugging tool that I am unfamiliar with? At this stage my debugging skills are limited to placing breakpoints and clicking the bug icon.
Appreciate any help.
java.util.Calendar
in the box "Apply renderer to objects of type..." new SimpleDateFormat("yyyy-MM-dd").format(getTime())
If you need to deal with TimeZones, you can use this ampliation to JB Nizet solution:
new SimpleDateFormat("dd-MM-yyyy HH:mm:ss.SSS").format(getTime()) + " " + getTimeZone().getDisplayName(false,TimeZone.SHORT) + " " + getTimeZone().getRawOffset()/3600000
Example output:
Shows the TimeZone name and the offset in hours
Global configuration is also possible, go here to view all active detail formatter and to add new ones: Preferences > Java > Debug > Detail Formatter
Qualified type name: java.util.Calendar
Detail formatter code snippet returns the String you defined, in my case german format of date + time:
this.get(Calendar.DAY_OF_MONTH ) + "." +
(1 + this.get(Calendar.MONTH ) ) + "." +
this.get( Calendar.YEAR )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.