# Expiration date of a product

**URL:** <https://discourse.nodered.org/t/expiration-date-of-a-product/63639>\
**Category:** General\
**Created:** [8 June 2022 20:43 UTC](https://discourse.nodered.org/t/expiration-date-of-a-product/63639 "2022-06-08T20:43:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anairamy](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@anairamy](https://discourse.nodered.org/u/anairamy)\
**Post date:** [8 June 2022 20:43 UTC](https://discourse.nodered.org/t/expiration-date-of-a-product/63639/1 "2022-06-08T20:43:27Z")

</div>

Hi everyone!  
Can anyone help me to create a function that apresents the expiration date of a product?  
I create this node about a product:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/f/3f2365307411b5ee8dc2f081818843fb679289ed.png)

"Farm" function:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/3/330c8a425612e3f4cbfd6ec54c28820604cd1ac6.png)

My goal is to create a notification when a product is about to expire.

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [9 June 2022 14:29 UTC](https://discourse.nodered.org/t/expiration-date-of-a-product/63639/2 "2022-06-09T14:29:15Z")

</div>

You will need to provide more information - what are you stuck with ?

---

<div class="post-metadata">

**Author:** ![ScheepersJohan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scheepersjohan/32/39556_2.png) [@ScheepersJohan](https://discourse.nodered.org/u/ScheepersJohan)\
**Post date:** [9 June 2022 14:34 UTC](https://discourse.nodered.org/t/expiration-date-of-a-product/63639/3 "2022-06-09T14:34:50Z")

</div>

> [@anairamy](#):
>
> My goal is to create a notification when a product is about to expire.

If I understand you correctly you want to store all the product information in a DB including expiry date.

Then you just need to select the data say once a day from the DB and compare it to the date now and if it is less say than one week you need to flag 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:** [8 August 2022 14:35 UTC](https://discourse.nodered.org/t/expiration-date-of-a-product/63639/4 "2022-08-08T14:35:41Z")

</div>

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