# Function node - getFullYear error

**URL:** <https://discourse.nodered.org/t/function-node-getfullyear-error/42926>\
**Category:** General\
**Created:** [20 March 2021 13:16 UTC](https://discourse.nodered.org/t/function-node-getfullyear-error/42926 "2021-03-20T13:16:36Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 March 2021 15:18 UTC](https://discourse.nodered.org/t/function-node-getfullyear-error/42926/21 "2021-03-21T15:18:38Z")

</div>

Yeah I know Dave. But, around what Colin found, if the underlying lib decides to change the default, we have no power over that. Was just a suggestion for a feature request to allow the user to chose by adding an option in the config node. My feeling is something somewhere changed (under the hood in a dep) and when the op updated, he got this "something" newer that had changed somehow.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 March 2021 15:55 UTC](https://discourse.nodered.org/t/function-node-getfullyear-error/42926/22 "2021-03-21T15:55:24Z")

</div>

@rakgupta, did you do anything related to the mysql server? Changing anything in its config for example.  
Have you got a backup of the package-lock.json from when it all worked? If so have a look in there and find the entry for node-red-node-mysql, which will tell you what version it was using. Under that you should see the version of the mysql package that it was using. Then have a look in the latest and see what versions they are now.

> [@dceejay](#):
>
> my simplistic testing always seems to return strings anyway.

I can't easily test it myself at the moment, but that doesn't sound right. Everything I can find suggests that TIMESTAMP fields should come back as Date Objects.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 March 2021 17:01 UTC](https://discourse.nodered.org/t/function-node-getfullyear-error/42926/23 "2021-03-21T17:01:18Z")

</div>

> [@Colin](#):
>
> Everything I can find suggests that TIMESTAMP fields should come back as Date Objects.

indeed - that seems to be the "problem" - I have a simple table that auto adds a timestamp field and that currently comes back as a string.

And indeed I needed more coffee when updating it this morning... basically a no-op... now 0.1.6 def returns date type for the timestamp.

---

<div class="post-metadata">

**Author:** ![rakgupta](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rakgupta/32/42535_2.png) [@rakgupta](https://discourse.nodered.org/u/rakgupta)\
**Post date:** [21 March 2021 17:48 UTC](https://discourse.nodered.org/t/function-node-getfullyear-error/42926/24 "2021-03-21T17:48:44Z")

</div>

> [@Colin](#):
>
> did you do anything related to the mysql server?

Nope - no changes to the server or config.

> [@Colin](#):
>
> Have you got a backup of the package-lock.json from when it all worked?

Yeah - I offload a backup of the entire node-red directory every Saturday. This is from a backup about 20 days ago (when it was all working)

 ![Screen Shot 2021-03-21 at 12.42.55 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/6/d6a19b1d9355a22825f329bdeeff18b3fedafdc8.png)

This is the version that is on my "test" system (that does not work):

 ![Screen Shot 2021-03-21 at 12.46.55 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b9e983b1c1dc5620c89b53045ac99621160411d0.png)

---

<div class="post-metadata">

**Author:** ![rakgupta](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rakgupta/32/42535_2.png) [@rakgupta](https://discourse.nodered.org/u/rakgupta)\
**Post date:** [21 March 2021 17:53 UTC](https://discourse.nodered.org/t/function-node-getfullyear-error/42926/25 "2021-03-21T17:53:44Z")

</div>

> [@dceejay](#):
>
> now 0.1.6 def returns date type for the timestamp.

Is it available? I wanted to test this out but it is not showing as an available update.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 March 2021 18:00 UTC](https://discourse.nodered.org/t/function-node-getfullyear-error/42926/26 "2021-03-21T18:00:39Z")

</div>

> [@rakgupta](#):
>
> it is not showing as an available update.

If it isn't showing in the browser then, in a terminal, go into your .node-red folder (that is important) and run  
`npm install node-red-node-mysql`  
That might take a little while. At the end it will tell you which version it installed.  
Then restart node-red.

---

<div class="post-metadata">

**Author:** ![rakgupta](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rakgupta/32/42535_2.png) [@rakgupta](https://discourse.nodered.org/u/rakgupta)\
**Post date:** [21 March 2021 18:25 UTC](https://discourse.nodered.org/t/function-node-getfullyear-error/42926/27 "2021-03-21T18:25:00Z")

</div>

> [@Colin](#):
>
> If it isn't showing in the browser then

It just showed up and it now appears to work correctly.

**type of created: object,** value of created: Mon Jun 01 2020 05:15:00 GMT-0500 (Central Daylight Time) and getFullYear returns the correct year.

@Colin @dceejay - thanks so much for your help and the quick fix.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 March 2021 18:25 UTC](https://discourse.nodered.org/t/function-node-getfullyear-error/42926/28 "2021-03-21T18:25:54Z")

</div>

Phew. Apologies for the disruption, and thanks for reporting it

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 April 2021 18:26 UTC](https://discourse.nodered.org/t/function-node-getfullyear-error/42926/29 "2021-04-04T18:26:19Z")

</div>

Closed on 4 April 2021 18:26 UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/function-node-getfullyear-error/42926.md?page=1)
