Created
December 5, 2015 18:16
-
-
Save Yur-ok/675a9a4a2e2083220daf to your computer and use it in GitHub Desktop.
D:H:M:S
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Lesson1_frame5; | |
| /** | |
| * Created by Юрий on 05.12.2015. | |
| */ | |
| public class TimeMillis { | |
| public static void main(String[] args) { | |
| long ms = System.currentTimeMillis(); | |
| System.out.println(ms); | |
| long seconds = ms / 1000; | |
| long minuts = seconds / 60; | |
| int hours = (int)minuts / 60; | |
| int days = hours / 24; | |
| System.out.println(days + ":" + hours + ":" + minuts + ":" + seconds); | |
| } | |
| } |
Author
Когда запускалась программа в видео, я не знаю, да это и не важно. Важно другое: это ваш результат 16775:402613:24156786:1449407170. Он не верен, так как, например,ни минуты ни секунды не могут быть больше 59.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
В вашем видео ответе, программа запускалась 28 января 2014 года в 08:26:59, верно?