Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to add the timestamp in the scripts

Devtools_Barclays December 27, 2018

Hi ,

 

I want to print the timstamp at every point of the script , I am trying to use new Date()  module at different parts of script , but only last line of newdate is printed,

1 answer

1 accepted

1 vote
Answer accepted
Aidan Derossett [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 27, 2018

Hey there!

Would you mind sharing the script with me here so that I can take a look at it? You should be able to create a timestamp and log it out using the below method:

def now = new Date()

//Make sure to set change CST to your timezone log.debug(now
.format("yyyyMMdd-HH:mm:ss.SSS", TimeZone.getTimeZone('CST')))

P.S. you may have to change your logging level in order to see this logging statement. You can also try logging statements like:

log.info()
log.error()
log.warn()

Best,
Aidan

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events