java gettime

Solutions on MaxInterview for java gettime by the best coders in the world

showing results for - "java gettime"
Joséphine
17 Jul 2019
1String formatCode = "yyyy-MM-dd 'at' HH:mm:ss z"; // Example
2SimpleDateFormat formatter = new SimpleDateFormat(formatCode); // Time Formatter
3Date date = new Date(System.currentTimeMillis);
4
5String time = formatter.format(date);
6// e.g. time = 2021-04-15 at 11:11:11 UTC