G
Guest
I have some code to convert a date to the unixdatetime representation (number
of seconds since 1970). Only problem is that it only counts from the whole
day, it ignores the times part. So convert 1/1/1970 and 1/1/1970 8:00:00 AM
both return 0 but the last should return 28800.
My code:
Try
Dim dte As DateTime
dte = DateTime.Parse(CmdArgs(1))
Console.WriteLine(DateDiff(DateInterval.Second,
#1/1/1970#, dte))
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
When I try to add 12:00:00 AM to the date in the DateDiff funcion vs.net
removes that.
Any ideas?
of seconds since 1970). Only problem is that it only counts from the whole
day, it ignores the times part. So convert 1/1/1970 and 1/1/1970 8:00:00 AM
both return 0 but the last should return 28800.
My code:
Try
Dim dte As DateTime
dte = DateTime.Parse(CmdArgs(1))
Console.WriteLine(DateDiff(DateInterval.Second,
#1/1/1970#, dte))
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
When I try to add 12:00:00 AM to the date in the DateDiff funcion vs.net
removes that.
Any ideas?