pastebin

Paste Search Dynamic
Recent pastes
localDateTime endDate
  1. import java.time.OffsetDateTime;
  2. import java.time.LocalDateTime;
  3. import java.time.ZoneOffset;
  4.  
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. public class Main
  7. {
  8.         public static void main (string[] args) throws java.lang.exception
  9.         {
  10.                 OffsetDateTime localDateTime = LocalDateTime.now(ZoneOffset.UTC).atOffset(ZoneOffset.UTC);
  11.                 long milli = localDateTime.toInstant().toEpochMilli();
  12.         OffsetDateTime endDate = localDateTime.plusYears(1);
  13.                 system.out.println(localDateTime);
  14.                 system.out.println(endDate);
  15.                 system.out.println(milli);
  16.         }
  17.  
  18. }
Parsed in 0.021 seconds