Calendar Page BirthDate Convert Wrong!

Snitz™ Forums .NET Core
https://www.reddick.co.uk/mvc/Topic/Posts/6140?pagenum=1
5/20/2024

Topic


sadra
Calendar Page BirthDate Convert Wrong!
7/4/2020


Hi...
Calendar Page BirthDate Convert Wrong!
please see the screenshot

 

Replies ...


sadra
7/5/2020


Ok, I now see the issue. your DOB is stored in the database in gregorian as 19780711 which as you say is 1357/04/20 however the problem arises because 11th July 2020 is indeed the 21/04/1399 in your calendar rather than 20/04/1399

Next year it will be on the correct day, it is something to do with leap years I think possiblyنوشته شده توسط HuwR


Ok.. you are right...
tanx
HuwR
7/4/2020


Ok, I now see the issue. your DOB is stored in the database in gregorian as 19780711 which as you say is 1357/04/20 however the problem arises because 11th July 2020 is indeed the 21/04/1399 in your calendar rather than 20/04/1399

Next year it will be on the correct day, it is something to do with leap years I think possibly
HuwR
7/4/2020


Actually thinking about this it may just be a UTC time issue since it is in July. When storing the date of birth it does not have a time in the database so it sets the time to 00:00 when converting DOB, tis is probably where it is going wrong and the date is slipping.

I will adjust the code so that rather than using 00:00 for the time part it uses midday instead, this should then negate and UTC conversion problems.
HuwR
7/4/2020


I'll take a look, but may not be much I can do since date conversion is done by the system not me.
© 2016-2024 Snitz™ Forums MVC