Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option with ${Date} Shows 1 Year ahead #399

Closed
kjtsm opened this issue Dec 29, 2019 · 4 comments
Closed

Option with ${Date} Shows 1 Year ahead #399

kjtsm opened this issue Dec 29, 2019 · 4 comments

Comments

@kjtsm
Copy link

kjtsm commented Dec 29, 2019

Describe the bug
Rundeck Version: 3.0.24-20190719
Option Type: Text
Input Type: Plain text
Default Value: ${DATE:MM-dd-YYYY}

The option value should be 12/29/2019 when you run today(on 12/29/2019) but it has 12/29/2020.

It worked yesterday on 12/28/2019, the option variable had 12/28/2018.
No server changes made.
The server date is synced with NTP and shows 12/29/2019 today.

Source page
Looks like someone else is reporting a similar bug.
#309 (comment)

@jiomanRO
Copy link

Hello,
Same issue with using job option ${DATE:YYYY-MM-dd HHmm}: - starting with 29.12.2019 00:00 it returns wrongly one year in the future: year 2020 - reproduced on an older Rundeck 2.7.3-1 and also on a newer Rundeck 3.0.12.
So also today 30.12.2019, the value returned for year is 2020.

@bloblek
Copy link

bloblek commented Dec 30, 2019

Hi,
@jiomanRO Please change ${DATE:YYYY-MM-dd HHmm} to ${DATE:yyyy-MM-dd HHmm}.
More info: http://dangoldin.com/2019/01/06/javas-simpledateformat-yyyy-vs-yyyy/
That should help.

@jiomanRO
Copy link

Hello,
@bloblek Thanks for the solution. Indeed changing the format to lower-case fixed the issue. The documentation from Rundeck points to https://momentjs.com/docs/#/displaying/format/ but doesn't contain this very useful info.
Thanks again.

@gschueler
Copy link
Member

note, this page https://docs.rundeck.com/docs/manual/job-options.html#defining-an-option details the use of ${DATE:format}, and also links to java SimpleDateFormat with the correct formatting information. yyyy is the correct format for the year, not YYYY (week year)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants