How to get Time Stamp in Java – How to append Time Stamp to File Name in Java

Many a times the design requires adding a time stamp to output of the program. For an instance, while creating the test reports pro-grammatically, it is always advisable to add a time stamp to the test report for keeping a record. This can be achieved by using the method as below:

Various options can be tried with SimpleDateFormat constructor. Thus using the code snippet above, you can append file name with time stamp.

Please feel free to let us know better way of doing the things. Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">