DateTool adding a year

steelej's Avatar

steelej

14 Jan, 2015 06:41 PM

Please see the attached. I'm using dateObj to pull the date from the data definition calendar. The date is correct in the xml output. However, when I use the DateTool to display it in another format, it is adding one year to the date. For the life of me I can't figure this one out.

Jim

  1. 1 Posted by steelej on 14 Jan, 2015 07:13 PM

    steelej's Avatar

    It seems to be adding a month too. I must be misusing the DateTool but I don't see it yet.

  2. 2 Posted by Ryan Griffith on 14 Jan, 2015 07:37 PM

    Ryan Griffith's Avatar

    Hi Jim,

    I am curious if the format you are passing into the toDate method needs some adjustment to account for leading zeros. When you have a moment, try the following and let me know how it works out:

    #set ( $dateObj = $_DateTool.toDate("dd-MM-yyyy",$dateText) )
    

    Please let me know if you have any questions.

    Thanks!

  3. 3 Posted by steelej on 14 Jan, 2015 07:44 PM

    steelej's Avatar

    That was it. Thanks for your help.

    Jim

  4. steelej closed this discussion on 14 Jan, 2015 07:44 PM.

Discussions are closed to public comments.
If you need help with Cascade CMS please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

26 Aug, 2016 01:19 PM
25 Aug, 2016 03:02 PM
25 Aug, 2016 12:50 PM
24 Aug, 2016 08:43 PM
24 Aug, 2016 07:20 PM
21 Aug, 2016 01:20 PM