Friday, June 12, 2015
Monday, May 4, 2015
Time range (08:00 - 18:00)
public class Run{
public static void main(String[] args) {
try {
java.text.SimpleDateFormat formater = new java.text.SimpleDateFormat("HH mm ss");
java.util.Date n = new java.util.Date();
String start = "08 00 00";
String end = "18 00 00";
String now = formater.format(n);
java.util.Date time1 = formater.parse(start);
java.util.Date time2 = formater.parse(end);
java.util.Date time3 = formater.parse(now);
long l1 = time1.getTime();
long l2 = time2.getTime();
long l3 = time3.getTime();
double difference = (l3 - l1) / 1000;
difference = (difference < 0 ? -difference : difference) / 60;
difference = difference / 60;
int a = (int) difference;
double d = (l2 - l3) / 1000;
d = (d < 0 ? -d : d) / 60;
d = d / 60;
int b = (int) d;
System.out.println("a : " + a);
System.out.println("b : " + b);
if ((0 <= a && a < 10) && (0 <= b && b < 10)) {
System.out.println("OK");
}
} catch (java.text.ParseException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
try {
java.text.SimpleDateFormat formater = new java.text.SimpleDateFormat("HH mm ss");
java.util.Date n = new java.util.Date();
String start = "08 00 00";
String end = "18 00 00";
String now = formater.format(n);
java.util.Date time1 = formater.parse(start);
java.util.Date time2 = formater.parse(end);
java.util.Date time3 = formater.parse(now);
long l1 = time1.getTime();
long l2 = time2.getTime();
long l3 = time3.getTime();
double difference = (l3 - l1) / 1000;
difference = (difference < 0 ? -difference : difference) / 60;
difference = difference / 60;
int a = (int) difference;
double d = (l2 - l3) / 1000;
d = (d < 0 ? -d : d) / 60;
d = d / 60;
int b = (int) d;
System.out.println("a : " + a);
System.out.println("b : " + b);
if ((0 <= a && a < 10) && (0 <= b && b < 10)) {
System.out.println("OK");
}
} catch (java.text.ParseException e) {
e.printStackTrace();
}
}
}
Monday, January 26, 2015
Eclipse versiyonları arasındaki farklar
Eclipse her yeni sürümünde sürüm numarasi vermek yerine bu şekilde isim verilmektedir. Bu isimlendirmeler arasında fark yeni bir Eclipse Release'tir.
Subscribe to:
Posts (Atom)