cancel
Showing results for 
Search instead for 
Did you mean: 

How to do to get date from the system

Occasional Contributor

How to do to get date from the system

Hi, please I need to get the date (TODAY) from the system... Do you know please which is the correct algorithm to apply ?

 

Thank you so much !!

 

Regards.

2 REPLIES 2
Moderator

Re: How to do to get date from the system

Hi Cecilia,

 

The following script should work if you put it in the Groovy Test Step: 

 

import java.text.SimpleDateFormat
def date = new Date()
sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
log.info(date)

Anastasia
Customer Care Team

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.
Community Hero

Re: How to do to get date from the system

You need to post the question with details and do not let users image your issue.

Where do you need to use it? In a soap request? rest ? groovy script?
What date format do you need?


Regards,
Rao.
New Here?
Join us and watch the welcome video: