I’ like to return this short date in the US format, the current culture of my application is en-GB, but I’d like it in en-US.
Here’s the code I have so far:
DateTime.Now.AddYears(-2).ToShortDateString();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
.ToString()extension method and enter the format:Custom date format options are documented here:
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx