Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Integer date
Message
From
22/05/2003 15:12:23
 
 
To
22/05/2003 12:13:12
Philip Jones
Cornwall County Council
Truro, United Kingdom
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Title:
Miscellaneous
Thread ID:
00791686
Message ID:
00791856
Views:
20
>Hi,
>I'm looking at an sql server application which stores dates as iintrgers eg 54050400.
>I haven't got access to any of the code that manipulates the data. Can anyone tell me how the dates might have been converted to integers so that I can work out how to read them.
>
>
>Phil.

From the SQL BOL:

Remarks
Values with the datetime data type are stored internally by Microsoft SQL Server as two 4-byte integers. The first 4 bytes store the number of days before or after the base date, January 1, 1900. The base date is the system reference date. Values for datetime earlier than January 1, 1753, are not permitted. The other 4 bytes store the time of day represented as the number of milliseconds after midnight.

The smalldatetime data type stores dates and times of day with less precision than datetime. SQL Server stores smalldatetime values as two 2-byte integers. The first 2 bytes store the number of days after January 1, 1900. The other 2 bytes store the number of minutes since midnight. Dates range from January 1, 1900, through June 6, 2079, with accuracy to the minute.

*****
BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform