.Net datetime comparisons to Javas getMilliseconds UTC time

  • Thread starter Thread starter Tim Greenwood
  • Start date Start date
T

Tim Greenwood

I don't seem to be able to find anything in .NET that will return a value
that I can compare to this. I'm being passed the msec from the java call
and need to compare it to my system date for security reasons. How can I go
about this? How to get an equivalent in .NET or convert the java value to
something usable?

Any help is greatly appreciated. We have a security person hired in for 3
days and today is his last day. He knows nothing of .NET and can't really
help.
 
Hmmm I believe that is just the HH.MM.SS.mm millisecond part within the
passing second of the current time is it not? IOW it will never be greater
than 999....
 
DateTime.UtcNow.Ticks / 10000 (number of 100 nanosecond intervals in a
millisecond)
 
Nope......NET UTC is returning ticks based on a date of January 1, 1 C.E.
not 1970 greenwich meantime.
But, knowing the date I figured it out.
TimeSpan ts =
System.DateTime.Now.Subtract(System.Convert.ToDateTime("1/1/1970 00:00:01
am"));
ts.TotalMilliseconds is the answer !

Thanks to all who replied
 
Back
Top