When i write a date in C# by using
DateTime.Now.ToString("yyyy/MM/dd")
then it returns 2010-09-10, but I need 2010/09/10. How do I make it output slashes?
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.
Specify a culture. Your current culture uses – for the separators, and that’s what ToString defaults to (your current culture), unless you override it.
You can try this:
but perhaps it would be better if you specified a different culture, for instance if you want the US culture:
Both of the above will give you / as a separator.