I got an If Condition (CurrentYearAnniversary < datetime.Today).
But because both have different date format, it failed to compare properly.
CurrentYearAnniversary is declared as DateTime variable with value assign to it.
Below is the output of both:
CurrentYearAnniversary: 09/12/2022 00:00:00
datetime.Today: 01/28/2022 00:00:00
Below is the format of the output:
CurrentYearAnniversary: dd/MM/yyyy 00:00:00
datetime.Today: MM/dd/yyyy 00:00:00
How do I change datetime.Today format to “dd/MM/yyyy 00:00:00” ?
Thanks for the info.
I just found out the CurrentYearAnniversary is in American date format(MM/dd/yyyy).
So my tutorial is working correctly.
I’m from Malaysia and and we always use (dd/MM/yyyy) format.
So if I’m dealing with date, I just need to assign the date, month, year properly first.
Then perform activities using American date format mindset.