fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.time.ZonedDateTime;
  4. import java.time.format.DateTimeFormatter;
  5. import java.time.format.FormatStyle;
  6. import java.util.Locale;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. String formatted = DateTimeFormatter
  14. .ofLocalizedDateTime(FormatStyle.FULL) // choose a style here
  15. .withLocale(Locale.JAPANESE)
  16. .format(ZonedDateTime.now()); // choose a timezone here
  17. System.out.println(formatted);
  18. }
  19. }
Success #stdin #stdout 0.15s 39976KB
stdin
Standard input is empty
stdout
2020年9月17日木曜日 1時06分53秒 グリニッジ標準時