Could you explain what exactly you are trying to achieve? Probably you may not need to do what you are trying to do now.
SQL Server stores a DATETIME value internally as two 4 byte integers. The first integer stores the number of days since 1900-01-01 and the second integer stores the number of milliseconds since midnight.
So, you may not need to do an additional conversion by yourself.What are you trying to achieve?
.