tags:

views:

76

answers:

3

How can I get a date that looks like this:

2010-07-08 23:59:59Z

from .NET's DateTime class?

+14  A: 

You're looking for the universal sortable format string, like this:

string str = DateTime.Now.ToString("u");
SLaks
A: 
string date = DateTime.Now.ToString("u");
Darin Dimitrov