Ask a Question

How to do to get date from the system

cpgutierrezm
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
richie
Community Hero

Re: How to do to get date from the system

Hi,

 

I'm unsure if I'm understanding correctly - I've got a groovy script that returns the current date that I found somewhere else on the web a while ago

 

import org.codehaus.groovy.runtime.*;
      
        def dateTime = new Date()
        log.info (DateGroovyMethods.format(dateTime, 'dd/MM/yyyy'))

Hope this helps, although unsure if it does!

 

richie

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
cpgutierrezm
Occasional Contributor

Re: How to do to get date from the system

It works !

Thank you so much !! 😃

cancel
Showing results for 
Search instead for 
Did you mean: