0

Have a function to get the current date, and when I echo it, it returns with a decimal number. I would like it to return with a date if possible.

<tr>
    <td>storeEval</td>
    <td>javascript{ ((new Date()).getMonth()+1)+'/'+(new Date()).getDate()+'/'+(new Date()).getFullYear()}</td>
    <td>currentdate</td>
</tr>
<tr>
    <td>echo</td>
    <td>${currentdate}</td>
    <td></td>
</tr>

And the results:

[info] Executing: |storeEval | javascript{ ((new Date()).getMonth()+1)+'/'+(new Date()).getDate()+'/'+(new Date()).getFullYear().toString()} | currentdate |
[info] script is: 11/17/2016
[info] Executing: |echo | ${currentdate} | |
[info] echo: 0.00032096171802054155 
jacksonSD
  • 677
  • 2
  • 13
  • 27
  • Perhaps a duplicate of [How to get current date in javascript](http://stackoverflow.com/questions/1531093/how-to-get-current-date-in-javascript) ? – MikeJRamsey56 Nov 17 '16 at 20:22
  • @MikeJRamsey56 I have the current date, my issue is with the echo return, which I've included now to show the issue more clearly. – jacksonSD Nov 17 '16 at 20:26
  • – MikeJRamsey56 Nov 17 '16 at 20:37
  • @MikeJRamsey56— *toDateString* returns an implementation dependent string that may well vary between implementations. – RobG Nov 18 '16 at 00:33
  • Yes but the [claim](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toDateString) is that it works on the following. Desktop: Chrome, Firefox (Gecko), Internet Explorer, Opera, Safari. Mobile: Android, Chrome for Android, Firefox Mobile (Gecko), IE Mobile, Opera Mobile, Safari – MikeJRamsey56 Nov 18 '16 at 00:59

0 Answers0