The date has gone crazy

Ciao a tutti!
I created a function to calculate a quote to which products are added.

Once you add a product and save the quote, the saved date goes crazy and puts an absurd year…
Can anyone help me figure out what the problem might be? Thanks :slight_smile:

Link video:

Hi @Indave,

Well, seems that you’re storing the value of 1882023 into the Date / Datetime property - and the result is absolutely correct (for Adalo :slight_smile: ). Adalo stores date/datetime as a number of days since 1/1/1970. So 1882023 days since that date is Sunday, 22 October 7122 :).

I am not sure how did you implement date selection in your app, but I would advice to use Datepicker for this and make sure that you’re storing the date into the correct property type (date/datetime or number if you’re absolutely sure what you’re doing).

Best regards, Victor.

Thank you Victor.
However, I think there is something wrong… is a value that is passed formatted, I don’t understand why it should behave this way.
For now I have remedied the problem by having the value fished from today’s date–but I don’t want it to do that.

Hi @Indave,

Unfortunately you can’t take the date as text and pass it to the datetime property - you will get this weird results.
I can’t say where exactly is the issue. You can create the video how did you set this up, this might be helpful to diagnose the problem.

Best regards, Victor.

Ciao @Victor,
I retrieve the date value from an ‘input’, and the date is formatted as (DD,MM,YYYY). It occurs to me that the input becomes text and does not handle the date.

You shouldn’t use Input for entering dates, use Datepicker instead.

Perfect! It works! I replaced it wherever I needed date recovery.
Thank u so much

1 Like

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