This content has been marked as final. Show 4 replies
Use Date to get the current time/date stamp and SimpleDateFormat to format it in the style you want.
Sorry, but the answer you provided would give you the EXECUTION date, not the COMPILE date! Try again. Just wondering.
There may be third party libs that do what you want. Alternatively you could just keep the compile date in a Properties file but that would require you physically updating it yourself.
If you're using Ant you can have it maintain a file with the last build date in it, and that can be a .java file if you so desire.
Applications should be completely recompiled before shipping or deployment so it doesn't really make sense to have a compile date per Java source file.