Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 UTC dates in SQL

Author  Topic 

chunkydrew
Starting Member

3 Posts

Posted - 2004-07-01 : 15:30:58
Can anyone help me convert UTC dates in a dts package? I have a db I need to transform, but all the dates are in utc format. Is there a function I can use in an ActiveX transformation script to convert, say, 38166, to a valid datetime value? There seems to be almost no documentation in using utc in SQL.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-07-01 : 16:36:37
I've got a UDF that converts between one timezone to the next, but I don't understand what 38166 is. Could you explain this? If it's the number of milliseconds since 1970 then I've got a UDF for that as well. Let me know and I'll send you a link to the code.

Tara
Go to Top of Page

chunkydrew
Starting Member

3 Posts

Posted - 2004-07-02 : 13:03:12
This db provides dates, which the developer (CISCO) identifies as UTC, in the format 99999. Using this, 38169 converts to 7/2/04. I can use the
getutcdate() function to return the datetime for the current UTC, or I can CONVERT(int, datetime) to convert a datetime into UTC, but neither will work in an ActiveX script. Are we talking about the same thing, or is Cisco using UTC in a different way?

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-07-02 : 13:07:11
Ok, I would import the data into a staging table. The staging table would have the column data types as int for these dates. Once the data is in the staging table, you can then use T-SQL queries with CONVERT to get the data to your other tables.

Tara
Go to Top of Page
   

- Advertisement -