java date time and utc date time

hi

i have a client written in delphi
the backend is written in java (webservice)

when fetching a date field from the db, through java to delphi (TXSDateTime class), for some reason the date changes.
in the db: 30/07/2009 00:00:00
in delphi: xsdatetime.asdatetime = 29/07/2009 23:00:00 (1 hour before)
in delphi xsdatetime.asutcdatetime = 29/07/2009 21:00:00 (3 hours before)
i guess it's a matter of timezones but all we want is simply to fetch the same date as it appears in the DB

what are we missing?
thanks
0
amos
11/22/2009 4:31:14 PM
embarcadero.delphi.general 4258 articles. 0 followers. Follow

3 Replies
1500 Views

Similar Articles

[PageSpeed] 15

amos szust wrote:
> hi
> 
> i have a client written in delphi
> the backend is written in java (webservice)
> 
> when fetching a date field from the db, through java to delphi (TXSDateTime class), for some reason the date changes.
> in the db: 30/07/2009 00:00:00
> in delphi: xsdatetime.asdatetime = 29/07/2009 23:00:00 (1 hour before)
> in delphi xsdatetime.asutcdatetime = 29/07/2009 21:00:00 (3 hours before)
> i guess it's a matter of timezones but all we want is simply to fetch the same date as it appears in the DB


Assuming it is a simple SOAP service: can you the the date/time value in
the request XML? Is it the correct value? - The problem can be on the
encoding side (Java) or in the decoding side (Delphi).

Cheeers,
-- 
Michael Justin
SCJP, SCJA
betasoft - Software for Delphi™ and for the Java™ platform
http://www.mikejustin.com - http://www.betabeans.de
0
Michael
11/24/2009 7:19:28 AM
<amos szust> wrote
> when fetching a date field from the db, through java to delphi 
> (TXSDateTime class), for some reason the date changes.
> in the db: 30/07/2009 00:00:00
> in delphi: xsdatetime.asdatetime = 29/07/2009 23:00:00 (1 hour before)
> in delphi xsdatetime.asutcdatetime = 29/07/2009 21:00:00 (3 hours before)
> I guess it's a matter of timezones but all we want is simply 
> to fetch the same date as it appears in the DB
> what are we missing?

Why can't we all use the universal date-time format as 
expressed in newsgroup/email headers?
  Date: Sat, 21 Nov 2009 06:22:35 -0800
  Date: Thu, 22 Oct 2009 06:56:43 -0700
  Date: Thu, 22 Oct 2009 10:30:54 -0700
What is the name of this standard?  
Does this standard allow for milliseconds?
--JohnH
0
John
11/24/2009 12:18:21 PM
"John Herbster" <herb-sci1_AT_sbcglobal.net> skrev i meddelelsen 
news:186554@forums.codegear.com...
> <amos szust> wrote
>> when fetching a date field from the db, through java to delphi
>> (TXSDateTime class), for some reason the date changes.
>> in the db: 30/07/2009 00:00:00
>> in delphi: xsdatetime.asdatetime = 29/07/2009 23:00:00 (1 hour before)
>> in delphi xsdatetime.asutcdatetime = 29/07/2009 21:00:00 (3 hours before)
>> I guess it's a matter of timezones but all we want is simply
>> to fetch the same date as it appears in the DB
>> what are we missing?
>
> Why can't we all use the universal date-time format as
> expressed in newsgroup/email headers?
>  Date: Sat, 21 Nov 2009 06:22:35 -0800

Or perhaps a bit more modern format typically found in XML?
http://www.w3.org/TR/xmlschema-2/#dateTime
For example, 2002-10-10T12:00:00-05:00 (noon on 10 October 2002, Central 
Daylight Savings Time as well as Eastern Standard Time in the U.S.) is 
2002-10-10T17:00:00Z, five hours later than 2002-10-10T12:00:00Z.
-- 
Finn Tolderlund
0
Finn
11/24/2009 4:30:05 PM
Reply:

Similar Artilces:

date/time or date and time
I am setting up an SQL database and I will need to get differences in dates. For example I have a start date, start time, completion date and completion time and I want to get the difference between the start and completion. Would it be better to have one field with both date and time in it, or better to have a date field and a time field? Even though I have already started setting up the tables with seperate fields for date and time I am now leaning toward one field with date/time in it. (Only because that is the way I had to do it when setting up an Excel spreadsheet for a similar ta...

just Time or date portion of a date/time field
Good Day, From a DateTime data column how do I get just a Time portin or just a date portion of data to be displayed. i.e from 11/6/2003 10:03:20 AM I need to display date and time seperately in my data display page. Thanks Regards, In code you could use Dim dt as System.Date Dim day, month, year as integer day = dt.Day month= dt.Month year = dt.Year This also works with DateTime In SQL you could use DATEPART(<datepart>,<datetime>) where <datepart> is the abbreviations mentioned in post 385301 and <datetime> is a...

Convert MySql Date/Time to ASP.net Date/Time
I am pretty new to ASP.Net and to MySql. I am receive the following error message when I try to retrieve a date field: Unable to convert MySql date/time to System.DateTime The message points to the following code: Response.Write(dtrReader("fldDate")) What do I need to do so that I can read this date into my program.  It appears they two systems store dates differently, but I do not know enough about either to know where to begin. Please help Thanks Is your issue like this one? Also try setting the "Allow Zero Datetime" = True in the ConnectionString.http://forums.mysql.com/read...

Compare file modified date time to system date time
I have an client application that uploads a zip file to a server. Once the server application sees the file, it processes the file. The process starts before the zip file is completely downloaded to the server. I want to delay the process until the file is completely downloaded. I am trying to compare the zip file modified date time with the system date time. If the zip file modified date time is 5 seconds older than the system date time then I know the zip file downloaded. At this point I will continue to process the zip file. I am not sure how I can compare the two date time. The DateTime....

Adding time for past dates dates or correcting a time entry
Hi all, We are using Bugzilla to record time spent on bugs. Is there a way for a person to add time on a previous date? Or is there a way to correct an entry? I can access the DB by an ODBC connector, but I'm reluctant to change the date in bugs_activity table. Thanks Sanjay On Jul 29, 3:58=A0pm, Sanjay Jain <sanjayjai...@gmail.com> wrote: > Hi all, > > We are using Bugzilla to record time spent on bugs. Is there a way for > a person to add time on a previous date? > > Or is there a way to correct an entry? > > I can access the DB by...

Date entered...add time value to make date/time field
Windows XP Professional InfoMaker v 9.0.2 Build 7509 Our database contains a date/time stamp for when a specific activity happens to each shipment. I would like the users to be able to simply enter a date for a specific work day. I need to get a list of shipments where the time of one activity occurred on the entered date prior to 9:20. How can I create a computed field that will basically concatenate/amend the entered date with 9:20 that will later be used for criteria in returning rows? Thanks in advance for any help you can provide! Rita Palazzi Senior Engineer /...

Server Date & Time vs. Local Date & Time
I have the following code (which some members assisted with) and it works great locally... It takes the date and time and formats just the way I want:  e.g.:  10/28/2008 13:58:44 becomes 102820080158 (which is what I want) But, when I upload the app to our server the date pulled is:           10/28/2008 1:59:37 PM As a result the date skips the formatting and does not work, so how can I code this so the date/time will be the same whether its local or on a server, and I have adjusted the regional settings to match - and same issue...

just Time or date portion of date/time field: SOMEBODY PLS
Good Day, From a DateTime data column how do I get just a Time portin or just a date portion of data to be displayed. i.e from 11/6/2003 10:03:20 AM I need to display date and time seperately in my data display page. Thanks Regards, When you pull in a SQL datetime column value into your .NET code, it is usually cast to a .NET DateTime type... something like this: System.DateTime TheDateAndTime = (System.DateTime)someDataReader["MySQLDateColumn"] Then you can use a variety of .NET methods included in the DateTime class to convert to a strin...

Removing Time from date time
We would like to form a recordset that would have the datetime column be just the date. We have students visiting our web several times a day and each of these are counted as distinct dates. We would like just the total number of days that they used the web not the total number of times they accessed the web. Thanks Jim You can use date function on datetime column, or use cast. eg: select datetime_col, date(datetime_col), cast(datetime_col as date) from some_table Hope this helps, Goran jmwarren wrote in message <39A66A36.8B355AA6@pilot.msu.edu>... >We would li...

DATE field to DATE/TIME
Hello, If the field is defined as a DATE and you do: select datefield+1 from mytable Does the ODBC API (actually ASA 9.02 backend) return a field that is DATETIME or a DATE field? It is messing up my compiled application and seems to be coming back as DATETIME. Thank you. -Robert You are correct, the value is being returned as a TIMESTAMP. You can verify this through using the EXPRTYPE() builtin function, as in select exprtype('select datefield+1 from mytable', 1) from dummy which will return TIMESTAMP. Exprtype is documented in the help. You alm...

Date raw date time
I have a value in a string array that is {3/15/1976} When I do a tostring with a short date it changes that to 15/03/1976 Is there a way I can get just the raw text out of the string? Without it giving it to me as a date? Thanks Hi latrotter2, If you have a DateTime object and want to the string value to have a certain format, you must pass the format to the .ToString() Methos. Example: [Visual Basic] Dim tempDateString As String = DateTime.Today.ToString("M/d/yyyy") Response.Write(tempDateString) [C#] string tempDateString = DateTime.Today.ToStr...

Convert Date/Time to Date
Hi I'm using .NET 2.0 framework with a Postgres DB. I'm getting date values from the table 'creationdate' and I need to compare it with other date value (given by me). The thing is that tha date returned from the DB comes like this '27-03-2006 0:00:00' and the date value that I use to campare comes like this '27-03-2006'. I want to know how to convert the returned date value from the DB to date only...?! I tried using the following: SELECT CONVERT(char(10),creationdate,101) AS date FROM calendar.events WHERE date = "myDate"; but it gives me an error: syntax error at or near "," at c...

Dates, Dates, Dates!
Hello all... I am in the process of building an appointment system, and I am trying to see if I can get some pointers on which way to go on this. The first version of this appointment system was very lo-tech, and it stored all of the possible dates/times in the database. Once a user booked an appointment, their information was logged to that date/time, and then that date/time would no longer show in the list of possible openings. This was great for a temporary fix, but with having to pre-populate all of the dates/times, the system would eventually have to be updated to continue on pa...

Missing date in time/date field
Hi, I noticed that some postings (including mine) don't show the date, just the time of sending the message. What setting do I need to change to enable this? MegaMad - Leo MegaMad wrote: > Hi, > > I noticed that some postings (including mine) don't show the date, just > the time of sending the message. > > What setting do I need to change to enable this? > > MegaMad - Leo Any post sent today will only show the time, those same posts will show the date and time tomorrow. -- Brian .. http://www.mozilla.org .. http://ilias.c...

Web resources about - java date time and utc date time - embarcadero.delphi.general

Java - Wikipedia, the free encyclopedia
This article is about the Indonesian island. For the programming language, see Java (programming language) . For other uses, see Java (disambiguation) ...

Makers of notoriously insecure Java software ordered to help PC users clean it up
... of the world's largest tech companies, has been accused by the US government of misleading consumers about the security of its software Java, ...

Contract Junior Programmer (JAVA Programming) 151222/JP/851
Defining Technology for Australia's IT Leaders.

Indonesian police arrest another suspected terrorist in West Java: report
Another suspected terrorist has reportedly been arrested by Indonesia's counter terrorism forces in West Java.

Suspected terrorists arrested in Indonesia 'planned to detonate bombs' in Java, Sumatra
... Islamic State supporters who were allegedly preparing terror attacks for later this month. In a series of raids across the island of Java ... ...

Oracle settles with FTC over Java’s “deceptive” security patching
Way to go, Oracle. (credit: Oracle PR) Oracle received a public slap on the wrist from the Federal Trade Commission over Java SE, the desktop ...

Oracle agrees to warn Java users of malware risk
Oracle is about to issue a warning that Java users could be exposed to malware, the media have reported on Tuesday. The exposure is the result ...

Judge William Alsup: Master of the court and Java
Mastery of the courtroom wasn't all that Alsup brought to the Oracle v. Google trial. He also showed mastery of the subject matter, more than ...

Court tosses out Oracle's bid to disqualify Java expert
A court in California has declined Oracle's bid to disqualify an expert in its copyright dispute with Google over the use of Java code in the ...

Regulators Accuse Oracle Of Deceiving Customers About Security Of Java Updates
The owners of more than 850 million personal computers using Oracle’s Java Platform Standard Edition were misled about the security of their ...

Resources last updated: 1/3/2016 7:44:06 PM