why converting a date to milisecond is different in java and c#
hi
i wan convert date milisecond.
i use cod in c# :
datetime date = convert.todatetime("2014 / 07 / 28"); datetime jan1st1970 = new datetime(1970, 1, 1, 0, 0, 0, 0, datetimekind.utc); double millis = (double)((date - jan1st1970).totalmilliseconds);
it returns 1406505600000
but change java , returns 1406489400000
simpledateformat sdf=new simpledateformat("yyyy-mm-dd"); date mdate=sdf.parse("2014 / 07 / 28"); double millis= mdate.gettime();
why different?
i not sure, thing can think of timezone difference or culture setting.
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment