fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. import java.time.* ;
  8. import java.time.format.* ;
  9.  
  10. /* Name of the class has to be "Main" only if the class is public. */
  11. class Ideone
  12. {
  13. public static void main (String[] args) throws java.lang.Exception
  14. {
  15.  
  16. System.out.println(
  17.  
  18. LocalDateTime
  19. .parse(
  20. "2020-06-16 14:00:00"
  21. .replace( " " , "T" )
  22. )
  23. .atZone(
  24. ZoneId.of( "Europe/Paris" )
  25. )
  26. .toInstant()
  27. .atOffset( ZoneOffset.UTC )
  28. .format(
  29. DateTimeFormatter.ofPattern( "uuuu-MM-dd HH:mm:ss" )
  30. )
  31.  
  32. );
  33.  
  34.  
  35. }
  36. }
Success #stdin #stdout 0.12s 55868KB
stdin
Standard input is empty
stdout
2020-06-16 12:00:00