469,578 Members | 1,731 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

DateTime, Web service, Sql server

Hi,
I have Win application -> Web service -> Sql Server. The user input
date and time in format dd/MM/yy hh:mm. I convert it to datetime and
send it to a web service which save it to the db. But the datetime is
changed according the timezone of the server and the client machine (I
think).

What can I do that the date to stay the same (I want to send datetime
type and I don't want to change windows setting of the server and the
client machine)?

Thanks.

Nov 17 '05 #1
5 7088
Iwan,

Why do you not sent Zulu/GMT/UTC (three words for the same) to your
webservice

http://msdn.microsoft.com/library/de...ltimetopic.asp

http://msdn.microsoft.com/library/de...tcnowtopic.asp

I hope this helps,

Cor
Nov 17 '05 #2
Iwan,

Which layer is it being translated in? Is the proxy translating it when
it is sent to the web server? Or is the SQL Server translating it?

Either way, before you send it, you might want to convert it to GMT, by
making a call to the ToUniversalTime method on the datetime before you send
it to the web service.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Iwan Petrow" <xx****@abv.bg> wrote in message
news:11********************@g44g2000cwa.googlegrou ps.com...
Hi,
I have Win application -> Web service -> Sql Server. The user input
date and time in format dd/MM/yy hh:mm. I convert it to datetime and
send it to a web service which save it to the db. But the datetime is
changed according the timezone of the server and the client machine (I
think).

What can I do that the date to stay the same (I want to send datetime
type and I don't want to change windows setting of the server and the
client machine)?

Thanks.

Nov 17 '05 #3
Hi,

That's weird, I have never hear of that, how the client or the web service
knows that the opposite is in a different timezone?

I would bet you have another problem somewhere else.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Iwan Petrow" <xx****@abv.bg> wrote in message
news:11********************@g44g2000cwa.googlegrou ps.com...
Hi,
I have Win application -> Web service -> Sql Server. The user input
date and time in format dd/MM/yy hh:mm. I convert it to datetime and
send it to a web service which save it to the db. But the datetime is
changed according the timezone of the server and the client machine (I
think).

What can I do that the date to stay the same (I want to send datetime
type and I don't want to change windows setting of the server and the
client machine)?

Thanks.

Nov 17 '05 #4
Hi,

When I set time zone of the serever machine +2 and timezone of the
client machine +1 (windows os settings) I have this problem. When they
are equal (+2) there is no ptroblem.

Nov 17 '05 #5
> That's weird, I have never hear of that, how the client or the web service
knows that the opposite is in a different timezone? I would bet you have another problem somewhere else.


I've seen this problem with Java webservices talking to .NET ones - the
..NET SOAP deserializer does some time zone alterations under the hood
so that even if you send a UTC date/time from Java, you end up with a
local date/time in .NET. It's all very annoying. I gather it's fixed to
some extent in .NET 2.0, but the problem basically stems from the
DateTime type not having any timezone information.

Jon

Nov 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Iwan Petrow | last post: by
1 post views Thread by M DL via .NET 247 | last post: by
3 posts views Thread by Larry Bertolini | last post: by
2 posts views Thread by PurpleServerMonkey | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.