Possible Duplicate:
In C#, given a DateTime object, how do I get a ISO 8601 date in string format?
I’ve a variable with type DateTime in my C# code.
How do I convert this to “Z” format?
Thanks.
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.
Do you mean converting to a string time/date like
2009-06-15 20:45:30Z? If so then try:See http://msdn.microsoft.com/en-us/library/az4se3k1.aspx for info on Standard Date and Time format strings. In particular read the entry on using the “
Universal Sortable ("u") Format Specifier” whcih explains why I have theToUniversalTimecall in there.