473,789 Members | 2,537 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 2268
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
6020
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
2872
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
1926
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
1439
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
2793
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
9506
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
10403
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
10136
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
9978
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
9015
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...
1
7524
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5414
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4087
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
3695
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.