Forum Discussion

vpachpute1's avatar
vpachpute1
Frequent Contributor
7 years ago

To change Ubunty System date using Groovy.

Hi

 

I have one scenario which needs to stimulate the system date.

 

1. Actually I have to change system date as Today's date - 2 days.

2. Then do the purchase (When system date is 2 days back so that every date will be 2 date back in background.)

 

Can anyone please help me to do this using Groovy. I am using Ready APi on Ubuntu machine

 

Regards

Vishal

 

3 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Is date of the system needs to be changed? or just date needs to changed in the purchase request ?
    • vpachpute1's avatar
      vpachpute1
      Frequent Contributor

      Hi

       

      Actually System date needs to change.

       

      Note: There is no any change to do back dated purchase using API. So needs to change system date.

       

      Thanks in advance

       

      Regards

      Vishal

      • groovyguy's avatar
        groovyguy
        Champion Level 1

        I think setting the system time is outside of the normal wheel house for what groovy scripts can do. That being said, you might be able to write an external process (.sh file or some such) that handles that, and set up a groovy script to launch that file as an external process.