2
How do I capture only the last 2 digits of the year in function DateTime.Now.Year.ToString()
?
I need to do a validation, for example, if the year is 2019, I need you to compare only 19, I will not post the code, because it is only the DateTime.Now.Year
even though I need to work and I’m not getting it, the rest of the code has rejected that part
Wouldn’t that be:
DateTime.Now.ToString("yy");
?– Roberto de Campos
I also thought it would be, but it didn’t work, returns me an empty string
– Jonathan Igor Bockorny Pereira
If it returns an empty string probably the format and/or type received from "date" is wrong.
– Leandro Amarilha