Skip to content

Instantly share code, notes, and snippets.

@abbath0767
Created February 24, 2016 15:32
Show Gist options
  • Save abbath0767/d42830a89ca651f9df2f to your computer and use it in GitHub Desktop.
Save abbath0767/d42830a89ca651f9df2f to your computer and use it in GitHub Desktop.
Beginner Series #2 Clock
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