Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public class DateFormatSampleCode {
  2. public static void main(String[] args)
  3. {
  4. LocalDateTime localDateTime = LocalDateTime.ofEpochSecond(1459123200, 0, ZoneOffset.UTC);
  5.  
  6. System.out.println(localDateTime);
  7. localDateTime = localDateTime.minusDays(1);
  8. System.out.println(localDateTime);
  9.  
  10. ZonedDateTime zonedDateTime = ZonedDateTime.of(localDateTime, ZoneId.of("Europe/Stockholm"));
  11.  
  12. System.out.println(zonedDateTime);
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement