Java
- 15 ответов
- 0 вопросов
14
Вклад в тег
import java.util.Scanner;
public class Main {
private static Integer invertDigits(Integer number) {
Integer temp = 0;
while (number != 0) {
temp = temp * 10 + number % 10;
number /= 10;
}
return temp;
}
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(System.in);
Integer number;
System.out.print("Enter number: ");
number = scanner.nextInt();
System.out.println("Reverse digit order: " + invertDigits(number));
}
}
Timestamp stamp = new Timestamp(1593864000000L); // 07.04.2020 12:00 UTC
System.out.println(stamp.toString()); // 2020-07-04 15:00:00 (Moscow UTC+3)
System.out.println(stamp.getTime() == 1593864000000L); // true