Created
February 24, 2016 15:32
-
-
Save abbath0767/d42830a89ca651f9df2f to your computer and use it in GitHub Desktop.
Beginner Series #2 Clock
This file contains 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
import java.util.*; | |
public class Clock | |
{ | |
public static int Past(int h, int m, int s) | |
{ | |
Date d = new Date(); | |
int year = d.getYear(); | |
int month = d.getMonth(); | |
int day = d.getDate(); | |
Date midNigth = new Date(year, month, day); | |
Date testDate = new Date(year, month, day, h, m, s); | |
long past = testDate.getTime() - midNigth.getTime(); | |
return (int)past; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment