473,802 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help getting timezone info in webservice

(I forgot to mention that I'm using C#)
-------------------
When communicating with a server via webservices, I need to view and set the
timezone information for a simple object (it contains one DateTime and one
string).

Is there a way to force the DateTime part into a string on the client size,
so I can examine the contents (custom serializer/deserializer?)?

After about two days straight, I'm getting more familiar with XML and
webservices. However most of the examples that seem close to what I'm trying
to do are written with respect to files not webservices, or they involve
modifications on the server side.

I have several VS generated webservice references in my client side project
which have many methods based on this simple object (or arrays of them). How
do I get the webservices to use my own serializer/deserializer for this one
custom object type?

Thanks,
-Bill

Mar 8 '06 #1
5 2271
Hi Bill,

If you generate the proxy using the VS.NET, it will automatically parse the
whole DateTime information and convert the data into local DateTime. Here
are two options you can choose to get the timezone info.

1. You can put the DateTime into a string with Time Zone and parse on the
client side.
2. You don't modify the webservice and you have to parse the SOAP message
yourself.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Mar 9 '06 #2
Thanks for the reply, Kevin.

I don't have control over the way the DateTime is served up from the server,
so I'm left with a client side solution. Do I have to parse everything in
the webservice calls myself, or is there a way to just parse the object I'm
interested in? I've seen some examples which allude to this, but they are
all based on xml in and out of files and I'm not sure how it would apply to
webservice calls.

Incidentally, the reason I need to do this is because .NET maps these two
values to the same DateTime value (if the os is running in a central time
zone which observes daylight savings) and my app needs to distinguish between
the two.
<calendar xsi:type="xsd:d ateTime">2006-10-29T06:30:00.000 Z</calendar>
<calendar xsi:type="xsd:d ateTime">2006-10-29T07:30:00.000 Z</calendar>

Mar 9 '06 #3
Hi,

AFAIK, you have to parse all the SOAP messages in order to find the
timezone data. This would be very complex. .NET will convert the time to
the local time according to the regional setting on the client machine. Can
you try to distinguish it from that setting if the converted time are the
same.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Mar 10 '06 #4
Thanks for the reply Kevin.

Yes, for 8759 hours of the year, the conversion works fine. However, if the
user's system is set to 'automatically adjust for daylight savings' then
there is a problem for 1 hour of the year.

On the day of the time change, there are two 1:30 AM times. One before the
time change, and another after we roll our clocks back. These are two
distinct times in the web services, but .NET is a little to smart and
converts them both to 1:30 AM for me on the client side. I have no way to
tell whether it is the first 1:30 AM or the second. For applications like
scheduling or billing, it is important to distinguish between the two.

I assumed that this would need to be resolved at the xml level because by
the time it is converted to a DateTime object the necessary information
(timezone) is lost, hence the post to this group.

This is a critical issue for us, so I'll pursue it through paid support.
Thanks for your assistance.

Mar 10 '06 #5
Hi,

You can try to contact Microsoft PSS for this issue. Here is the contact
information.

http://support.microsoft.com/default...;OfferProPhone

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Mar 14 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2676
by: Gaz | last post by:
How do I modify the Hello example that comes with the JWSDP-1.1 Tutorial so that it calls a different webservice (ie; an asp.net webservice) instead of the webservice I deploy as part of the Hello example? As the asp.net webservice is already deployed all I need to do is generate a stub for this webservice and slot it into the Hello example. Can someone please step through what needs to be done?? The tutorial says it can be done, but...
9
15532
by: Allen Davis | last post by:
Is there no way in ASP.NET to retrieve the client's timezone (or even local time, I'd settle for that) and passing it to the server? There must be a way of determining the timezone from which the web browser is coming from... mustn't there?
4
6021
by: Sean Shanny | last post by:
To all, Running into an out of memory error on our data warehouse server. This occurs only with our data from the 'September' section of a large fact table. The exact same query running over data from August or any prior month for that matter works fine which is why this is so weird. Note that June 2004 through today is stored in the same f_pageviews table. Nothing has changed on the server in the last couple of months. I upgraded...
13
14487
by: Stuart Bishop | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi. I'm trying to determine the best way of saying 'The current time in UTC with no time zone information'. I'm currently using CURRENT_TIMESTAMP AT TIME ZONE 'UTC' and inserting into columns defined as TIMESTAMP WITHOUT TIME ZONE which appears to
13
2874
by: Bruno Wolff III | last post by:
Recently there has been some discussion about attaching a timezone to a timestamp and some other discussion about including a 'day' part in the interval type. These two features impact each other, since if you add a 'day' to a timestamp the result can depend on what timezone the timestamp is supposed to be in. It probably makes more sense to use a timezone associated with the timestamp than say the timezone GUC or the fixed timezone UTC. ...
5
1928
by: Nathan Sokalski | last post by:
I asked a question about a week ago about how to get my local time, since my application is running on a server halfway around the world. I have determined that my code would look something like this: Dim servertime As Date = Date.Now Dim utctime As Date = servertime.ToUniversalTime() Dim localtime As Date
0
380
by: Bill | last post by:
When communicating with a server via webservices, I need to view and set the timezone information for a simple object (it contains one DateTime and one string). Is there a way to force the DateTime part into a string on the client size, so I can examine the contents (custom serializer/deserializer?)? After about two days straight, I'm getting more familiar with XML and webservices. However most of the examples that seem close to what...
1
1442
by: mmv | last post by:
Hello, Given Datetime value in a string, I wish to write a code where in I could convert the datetime to a value in particular timezone. For example, If the given datetime is 10:00 am in CST, i wish to convert it to Eastern(11:00 am) or anyother timezone depending on the user's system timezone. Any help would greatly be appreciated.
2
5173
by: Michele Locati | last post by:
Hi to everybody I'm working with dates and time, and I can't find the way to determine the time in a generic TimeZone. Here's an example of what I'd like to do: // I get the local date and time DataTime NowHere = DateTime.Now;
2
2795
raveendrabikkina
by: raveendrabikkina | last post by:
03/17 15:45:40 error Error creating form bean of class epost.form.BpUploadForm java.lang.InstantiationException: epost.form.BpUploadForm at java.lang.Class.newInstance0(Class.java:291) at java.lang.Class.newInstance(Class.java:259) at org.apache.03/17 15:45:03 info Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true 03/17 15:45:03 info Initializing,...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10536
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9114
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.