Two days difference between dates!!

Two days difference between dates!!

Post by Radu » Sat, 12 Jan 2002 22:45:58



Hello!

I am using ADO with Delphi to connect to a SQL Server 2000 Server.
When I make an insert with the date of my computer, on the server the date
is increased and saved with two days later. Why?

Thanks

--
Radu Vacaru

 ROLLSOFT S.R.L.

 Calea Dumbravii 21/62
 2400 Sibiu, Romania
 phone/fax 0040-69-232306

 http: www.rollsoft.ro

 
 
 

Two days difference between dates!!

Post by Dinesh T » Sat, 12 Jan 2002 22:53:33


Radu,

Check/correct the system date on the server.

Dinesh.


> Hello!

> I am using ADO with Delphi to connect to a SQL Server 2000 Server.
> When I make an insert with the date of my computer, on the server the date
> is increased and saved with two days later. Why?

> Thanks

> --
> Radu Vacaru

>  ROLLSOFT S.R.L.

>  Calea Dumbravii 21/62
>  2400 Sibiu, Romania
>  phone/fax 0040-69-232306

>  http: www.rollsoft.ro


 
 
 

Two days difference between dates!!

Post by BP Margoli » Sun, 13 Jan 2002 15:05:50


Radu,

How exactly are you specifying the date? Are you specifying it as a date,
e.g., "Jan 12, 2002" or some equivalent variation, or are you specifying it
an integer offset from a base date ... for example, as 37266 ?

If you are using the latter technique, be aware that SQL Server, currently,
stores data in datetime data types as an integer offset from a base date of
Jan 1, 1900. Is this the same base date used internally by Delphi? I would
wager that it is not. In general, DO NOT use knowledge of how products store
data internally when programming. I doubt whether Borland or Microsoft have
guaranteed that they will not change the base dates of their products.
However, both Borland and Microsoft will, I'm sure, guarantee that if you
specify "Jan 12, 2002" then their respective products will always correctly
interpret that.

-------------------------------------------
BP Margolin
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
can be cut and pasted into Query Analyzer is appreciated.


> Hello!

> I am using ADO with Delphi to connect to a SQL Server 2000 Server.
> When I make an insert with the date of my computer, on the server the date
> is increased and saved with two days later. Why?

> Thanks

> --
> Radu Vacaru

>  ROLLSOFT S.R.L.

>  Calea Dumbravii 21/62
>  2400 Sibiu, Romania
>  phone/fax 0040-69-232306

>  http: www.rollsoft.ro

 
 
 

1. obtain a day difference between two dates

i have a query that has a reqd date and todays date as individual columns, i
now require the difference between these dates excluding any weekends. can
this be obtained within this query or do i have to update the days
difference in a separate query

so i need help in obtaining the days diff and how to include it in the
query.

any suggestions would be appreciated.

2. Features I would like to see in the next version of SQL Server

3. Date difference in working days

4. Integrity Check and Txn Log Backup both Fail

5. Num of Days bet two dates ???

6. Paradox 7.0 Tables Slow or is it me?

7. Date's being incremented by two days

8. HELP: Optimizing Using Indexes and Text Fields

9. URGENT: query to calculate number of business days between two dates (no msg)

10. Two days added to date

11. Working days between two dates

12. finding # of days between two dates?

13. ??? Number of days betwwen two dates?