

ant.bat -Dunit=day -Dvalue=2 -f SetDateTime.xml increaseDateĮxample-2) Decrease the Date by 2 days. In the next few lines, you will find the desired commands to invoke the ANT targets.Įxample-1) Increase the Date by 2 days. But before you run the ANT script, make sure the following.Ģ.2.1- Set Java/JDK environment variables like JAVA_HOME, JDK_HOME, etc. How to call the ANT targets to change the system date/time.Ĭalling the ANT target is pretty simple. Follow all the steps to set up ANT and then directly copy-paste the below code snippet into a file and save it as. Sample ANT script to change system date and time.ĭear readers, in this section I’ve chipped in the full ready-to-use ANT script sample for your reference. Write Your First Ant Script – Example & Execution.
