Update - regarding your clarification:
I need to check datetime from a dominos database against asp.net datetime. The client is asking what would be the best format in which he should provide the datetime with the timezone.-meaning which is easily readable by .Net.
.NET supports parsing a wide variety of different formats so as long as it is in a fairly standard unambiguous format you should have no problem parsing it. But don't leave it to chance by relying on the default settings, use ParseExact or TryParseExact.
Check out the following resource for details on constructing the format string:
If you want to suggest something to him, then I would recommend following the ISO 8601 standard, which looks something like this: 2010-05-14T10:04Z
. DateTime.Parse
can also understand this format without needing to provide a format string.
Answering your original question:
What is the standard format for DateTime with timezone in a C# ASP.NET application?
Default formatting of DateTimes is based on the current locale. If you want a consistant format use either CultureInfo.InvariantCulture
or else a specific culture of your choice.
DateTime now = DateTime.Now;
string s = now.ToString(CultureInfo.InvariantCulture);
Result:
"05/14/2010 21:17:35"
Note that the default formatting doesn't include the time zone. You can specify your own formatting though:
string s = now.ToString("yyyy-MM-dd HH:mm:ss zz");
Result:
"2010-05-14 21:21:59 +02"