473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Date got offset by 1 day in webservice.

Hi,

I got a client application where it calls the webservices to save and
retreive dates from an Oracle database. 1 problem I've encountered is
that when a user select a certain date in the client application, when
this date got to the webservice, it got offset by 1 day (plus/minus 1
day depending on where is the user).

Is there any easy solution where the date appears and saved as it is?
i.e. user select 2nd July 2008, and the webservice gets and saves 2nd
July 2008 without doing any region offset.

Thanks,
Simon
Jul 21 '08 #1
1 1364
<Si******@gmail.comwrote in message
news:09**********************************@26g2000h sk.googlegroups.com...
Hi,

I got a client application where it calls the webservices to save and
retreive dates from an Oracle database. 1 problem I've encountered is
that when a user select a certain date in the client application, when
this date got to the webservice, it got offset by 1 day (plus/minus 1
day depending on where is the user).

Is there any easy solution where the date appears and saved as it is?
i.e. user select 2nd July 2008, and the webservice gets and saves 2nd
July 2008 without doing any region offset.
Where are the users located? In the same time zone as the server or a
different one?

You should create yourself a simple example to reproduce this and narrow it
down. For instance, it's possible the problem has nothing to do with Oracle,
so your reproducer should not include Oracle or any other database. Just
write a client that sends a known date and time to a service. Here's an
example. Service:

using System;
using System.Globalization;
using System.Web.Services;

namespace TimezoneServer
{
/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class Service1 : WebService
{
[WebMethod]
public string DisplayTimeAndDate(DateTime justDate, DateTime
dateAndTime)
{
return String.Format(
CultureInfo.InvariantCulture,
"justDate={0}|dateAndTime={1}", justDate, dateAndTime);
}
}
}

Client:
using System;

using TimezoneClient.TimezoneServiceProxy;

namespace TimezoneClient
{
internal class Program
{
private static void Main()
{
using (TimezoneServiceProxy.Service1 svc = new Service1())
{
DateTime justDate = new DateTime(2008, 1, 2);
DateTime dateAndTime = new DateTime(2008, 1, 2, 3, 4, 5);
string response = svc.DisplayTimeAndDate(justDate,
dateAndTime);
Console.WriteLine(response);
Console.Write("Press ENTER to finish: ");
Console.ReadLine();
}
}
}
}

Give that a try and see what the result is.
--
John Saunders | MVP - Connected System Developer

Jul 22 '08 #2

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

Similar topics

2
by: Erik Johnson | last post by:
the following script... <?php $times = array( '2004-04-04 00:31:00-06', '2004-04-04 01:00:00-06', '2004-04-04 01:59:59-06', '2004-04-04 02:00:00-06', '2004-04-04 03:00:00-06',
7
by: What-a-Tool | last post by:
How does the expire date work setting it server side with asp. I know with javascript setting it client side it will be set to the clients local time, and therefore expire when the clients local...
2
by: BjörnHolmberg | last post by:
Hi everyone! In the following code we get a UTC offset in xml. Since I want my WAP users in UTC+02:00 to see data on a server in some US time zone, a lot of confusion will be created from this...
14
by: Jon Davis | last post by:
I have put my users through so much crap with this bug it is an absolute shame. I have a product that reads/writes RSS 2.0 documents, among other things. The RSS 2.0 spec mandates an en-US style...
16
by: lwoods | last post by:
I want to calculate and display the 'mm/dd/yyyy' that is 10 years earlier than today. How do I do that? TIA, Larry Woods
13
by: maflatoun | last post by:
Hi, I have the following function to convert UTC time to Local time. It works perfect for GMT- (Minus) time zones however it provides incorrect results for GMT+(Plus) time zones? // Format to...
4
by: Holmsey | last post by:
Hi I have to convert am today's date and time (now) to a webservice. The example the web service gives was "1163313527144#" which comes out to 12/31/1969 06:00 PM. How do I convert a date to a 13...
10
by: Henrik Dahl | last post by:
Hello! I have an xml schema which has a date typed attribute. I have used xsd.exe to create a class library for XmlSerializer. The result of XmlSerializer.Serialize(...) should be passed as the...
2
by: =?Utf-8?B?Sm9ubnk=?= | last post by:
I have an ASP.NET 2.0 C# web application that is contacting an Exchange server using WEBDAV. It allows the users to look up appointments for a future date. The problem I have is determining the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.