# DateFormat bug in utils.dateFormat

**URL:** <https://forum.servoy.com/t/dateformat-bug-in-utils-dateformat/21355>\
**Category:** Feedback\
**Created:** [December 31, 2024, 8:32am UTC](https://forum.servoy.com/t/dateformat-bug-in-utils-dateformat/21355 "2024-12-31T08:32:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![briese-it](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@briese-it](https://forum.servoy.com/u/briese-it)\
**Post date:** [December 31, 2024, 8:32am UTC](https://forum.servoy.com/t/dateformat-bug-in-utils-dateformat/21355/1 "2024-12-31T08:32:53Z")

</div>

There seems to be a big bug in utils.dateFormat, I have never noticed that before.  
The year is wrong for 30.12. and 31.12. :

=\>var vDate = new Date()  
=\>vDate

Tue Dec 31 09:25:26 CET 2024

=\>utils.dateFormat(vDate,“YYMMdd”);

251231

Same for 30.12.  
I already created a ticket.

---

<div class="post-metadata">

**Author:** ![paronne](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/paronne/32/5096_2.png) [@paronne](https://forum.servoy.com/u/paronne)\
**Post date:** [December 31, 2024, 9:25am UTC](https://forum.servoy.com/t/dateformat-bug-in-utils-dateformat/21355/2 "2024-12-31T09:25:28Z")

</div>

Hi Micheal,

using the capital YY the year of the week; to get 24 as format you should use yyMMdd instead of YYMMdd.

Have a great new year,  
Paolo

---

<div class="post-metadata">

**Author:** ![briese-it](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@briese-it](https://forum.servoy.com/u/briese-it)\
**Post date:** [December 31, 2024, 9:30am UTC](https://forum.servoy.com/t/dateformat-bug-in-utils-dateformat/21355/3 "2024-12-31T09:30:08Z")

</div>

Oh man, I actually overlooked that. Thank you.  
Thanks, same to you ![:-)]( "Smile")
