Cool problem!
Fire this up in your SQL manager, lore and behold
select convert(datetime, 0)
select convert(bigint, convert(datetime, '19820201'))
-- 29981 equivalates to 1982-02-01 NOT 381403800
select convert(bigint, getdate())
-- today is 41906
select convert(bigint,dateadd(day, 1, getdate()))
-- tomorrow is 41907
declare @later int;
set @later = 381403800 - convert(bigint, getdate())
--select dateadd(day, @later, getdate()) would get overflow on the date type
declare @oneTenth int;
set @oneTenth = @later / 1000
select dateadd(day, @oneTenth, getdate())
-- so 1/1000 of the date you're reqesting is 3058-11-13
-- which is
select datediff(day, getdate(), convert(datetime, '3058-11-13'))
-- 381361 days from now or in rougly 1044 years, adding the zeroes you get 1.044.000 years
--so in a million years all that we know is considered to be over, including mssql?
-- your date is year 1046014 bc :)
wonder where you got that date from :)
in dot net you would get the date from that tick of 01-01-0001 00:00:38
this is intreguingly close to the dotnet value DateTime.Min (01-01-0001 00:00:00)
var dt = DateTime.MinValue.AddSeconds(38);
System.Diagnostics.Debug.WriteLine(dt.Ticks);
you get a value almost equal to the one you have
What you got to do is to check if the date being converted is below the minimum value the sql server can hold and then set it to null or the minimally supported value, see the first convert