Search code examples
javaandroiddatetimejulian-date

Convert JulianDate to Time in milli second


I know that if we want to convert Time in Milli second, then we should use the following function:

Time.getJulianDay(goToTime.toMillis(false), goToTime.gmtoff);

However, I want to know if I have a Julian Date Integer, then how would I convert it back to Time in Milli second? I searched the web and it seems there are no solutions for it..


Solution

  • You can use setJulianDay with toMillis to convert Julian date integer to time in msec. But remember converting from msec to julian day and then back msec won't give you the same result.