# Create Date format using Java (Modified Java Script Step)

**URL:** <https://community.automationedge.com/t/create-date-format-using-java-modified-java-script-step/2761>\
**Category:** Get Help & Discuss\
**Tags:** rpa\
**Created:** [January 1, 2021, 10:57pm UTC](https://community.automationedge.com/t/create-date-format-using-java-modified-java-script-step/2761 "2021-01-01T22:57:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fbaldin](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.automationedge.com/fbaldin/32/99_2.png) [@fbaldin](https://community.automationedge.com/u/fbaldin)\
**Post date:** [January 1, 2021, 10:57pm UTC](https://community.automationedge.com/t/create-date-format-using-java-modified-java-script-step/2761/1 "2021-01-01T22:57:57Z")

</div>

Hi  
In order to create a variable with the date you can use Modified Java Script Value with the following code, this will give the output: dd/mm/yyyy

\*var today = new Date(); \*  
\*var dd = today.getDate(); \*  
\*var mm = today.getMonth()+1; //January is 0! \*  
\*var yyyy = today.getFullYear(); \*

\*if(dd\<10) { \*

- dd = ‘0’+dd \*  
\*} \*

\*if(mm\<10) { \*

- mm = ‘0’+mm \*  
\*} \*  
_today = dd + ‘/’ + mm + ‘/’ + yyyy;_
