Mr. Smee Mr. Smee - 1 year ago 127
Java Question

JodaTime Get Current Milliseconds From Beginning Of Day

I'm trying to get the current milliseconds from the Beginning of that day. So I would like to make the following calculation.

. Any help would be greatly appreciated. Thanks

Answer Source
long result = new DateTime().millisOfDay().getMillis();  


long result = new DateTime().getMillis() - new DateTime().withMillisOfDay(0).getMillis();  


long result = new LocalTime().get(DateTimeFieldType.millisOfDay());
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download