Convert date between java and .net - 2 days off
问题 I need to transform a .NET DateTime to an equivalent Java Calendar representation. The .NET DateTime uses Ticks since Jan 1st 0001 (the .NET epoch) as the underlying representation. The Java GregorianCalendar uses milliseconds since Jan 1st 1970 (the Java (or Unix) epoch). The value is negative for dates before the Java epoch, as expected. Here I'm transforming the DateTime representation in millis since the Java epoch: var dt = new DateTime(1,2,3); //way, way back. var javaEpoch = new