Unix timestamp in C#, Java and php

For some strange reason the Dotnet framework has no conversion between a unix timestamp and a DateTime. Or has it? Why is it so when the framework has billions of other stuff that you never use. This functionality is actually something you would normally use in a system that communicates with the outside world.

This webpage has a solution
Another page about the same stuff

In my current project I am trying to convert a Java Calendar object to a C# DateTime through JNI (Java Native Interface). I have no perfect solution at this moment but I will try to use a unix timestamp though I am losing some precision.

Java has direct conversion from Calendar to Date (which is a representation of a unix timestamp). Bravo! :-)

php has lots of functions (like timetostr, time) to create and convert unix timestamps.

Kommentera

E-postadressen publiceras inte. Obligatoriska fält är märkta *