cancel
Showing results for 
Search instead for 
Did you mean: 

How to do to get date from the system

Highlighted
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
Highlighted
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)


Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
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:
Announcements
TechCorner Leaderboard
Compete with community members in the TechCorner Challenge and get into the Leaderboard!

Rank Participant Points Earned
1 msiadak 12
2 nmrao 8
3 HimanshuTayal 3
Top Kudoed Authors