How to get the full 4 digit year? For example, date of birth is 061439, how can I format this to get the 4 digit year? Thanks!
Please explain your question.
061439 represents a date of birth. I need to convert the date to 06141939. I need to get the full 4 digit year which is 1939.
021214 - The full date for this is 02122014. I need to get the full 4 digit year which is 2014.
If my question is still not clear, I will try and clarify. Thanks
DateTime dateParsed = DateTime.ParseExact("061439", "MMddyy", System.Globalization.CultureInfo.InvariantCulture)
To extract the Year from above date use
In case you are in need to go with specific culture, [en-Us or en-IN] follow the below links,
I hope you have a great day!