You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (JIRA)" <ji...@apache.org> on 2018/01/07 15:29:00 UTC
[jira] [Comment Edited] (GROOVY-8432) Weird behavior parsing dates
[ https://issues.apache.org/jira/browse/GROOVY-8432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16313202#comment-16313202 ]
Daniel Sun edited comment on GROOVY-8432 at 1/7/18 3:28 PM:
------------------------------------------------------------
{code:java}
(new Date().parse("yyy-MM-dd", "2018-01-01") - 1).format("YYYY-MM-dd")
{code}
*The above code should be corrected as follows:*
{code:java}
(new Date().parse("yyyy-MM-dd", "2018-01-01") - 1).format("yyyy-MM-dd")
{code}
P.S. The logic of parsing and formatting is same as the Java's
was (Author: daniel_sun):
Fixed by: https://github.com/apache/groovy/commit/033acfb429c3fd68acb3335ba684bbe1d42c76e3
> Weird behavior parsing dates
> ----------------------------
>
> Key: GROOVY-8432
> URL: https://issues.apache.org/jira/browse/GROOVY-8432
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 3.0.0-alpha-1, 2.5.0-beta-2, 2.4.13, 2.6.0-alpha-2
> Reporter: Paul King
> Assignee: Daniel Sun
> Fix For: 2.5.0-beta-3, 2.6.0-alpha-3, 2.4.14, 3.0.0-alpha-2
>
>
> # See: https://groovyconsole.appspot.com/script/5169573833736192
> And: https://twitter.com/jbaruch/status/948387448005976066
> Thanks to [~jbaruch] for bringing to our attention.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)