You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The third parameter nanoTime does not exist. I interprete your question as proposal to introduce such a third parameter. Well, I think there is no need for such a parameter in this initialization method which is rather about resource and context class loading.
Probably you look for a way to set up an application-wide clock which is once initiated by the server time. Time4J has such a clock package but Time4A unfortunately not yet. You might look at the actual implementations of the clock package of Time4J to model a suitable clock for Time4A.
Maybe this is an inspiration:
public class ServerTimeSource implements TimeSource<Moment> {
private final long offset;
public ServerTimeSource(long serverTimeUTInMillisecsSince1970) {
this.offset = serverTimeUTInMillisecsSince1970 - System.currentTimeMillis();
}
public Moment currentTime() {
long timeInMillis = System.currentTimeMillis() + this.offset;
return TemporalType.MILLIS_SINCE_UNIX.translate(timeInMillis);
}
}
Then you would instantiate the class once and store it in an application-wide location so it can be reused many times whenever you want to know the server time (as UT). If you also want to use the server time zone you have to store it as TZID or offset, too, in an application-wide location.
Hi,
Is it possible to set the base time manually?
For example: from the server (not the system)
Thank you very much for your great work
The text was updated successfully, but these errors were encountered: