Skip to content

Commit

Permalink
JODA INSTANT to millis
Browse files Browse the repository at this point in the history
  • Loading branch information
MherBaghinyan committed Apr 15, 2019
1 parent 3b43bdd commit 3ae6a12
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.baeldung.convert;

import org.joda.time.Instant;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
Expand Down Expand Up @@ -35,9 +37,12 @@ private static void calendar(Date date) {
}

private static void joda() {
org.joda.time.DateTime jodaDateTime = new org.joda.time.DateTime(new Date());
org.joda.time.DateTime jodaDateTime = new org.joda.time.DateTime();
long delta = jodaDateTime.getMillis();
System.out.println("Joda - Time in milliseconds : " + delta);

Instant jodaInstant = Instant.now();
System.out.println("Joda - Instant in milliseconds : " + jodaInstant.getMillis());
}

private static void java8() {
Expand Down

0 comments on commit 3ae6a12

Please sign in to comment.