Last post Aug 08, 2008 01:58 AM by r.heinkens
Aug 08, 2008 12:39 AM|nabeelcl|LINK
I have an issue with my webservice..
my webservice runs in a different time zone and my client is using the webservice to get some information which includes datetime.
i want the datetime exactly as it is in the database, but when the webservice gives me the date time, it gets converted to my local time automatically.. i guess that is the way datetime is handled by .net serialization..
How can i bypass this and get the original date time as in server db?
Aug 08, 2008 01:58 AM|r.heinkens|LINK
You could convert it to a string before sending and parse it back into a datetime after receiving. Do make sure you use the correct formatting when parsing the string. A more robust solution (but more work also) is to look at this article:
http://msdn.microsoft.com/en-us/library/ms973825.aspx and make use of ToUniversalTime() to convert all datetimes to some standard time and take it up from there.