33 lines
786 B
Java
33 lines
786 B
Java
package a6;
|
|
|
|
import java.lang.reflect.Array;
|
|
|
|
public class SysUtils {
|
|
|
|
public static void test() {
|
|
System.out.println("test");
|
|
}
|
|
|
|
public static int getDaySeconds(int time_val, int incdays) {
|
|
int time_zone = 8;
|
|
return (int)((time_val + time_zone * 3600)/3600/24 + incdays) * 3600 * 24 - 3600 * time_zone;
|
|
}
|
|
|
|
public static int now() {
|
|
return (int)(System.currentTimeMillis() / 1000);
|
|
}
|
|
|
|
public static final <T> T[] newArray(Class<T> cls, int size) {
|
|
T[] arr = (T[])Array.newInstance(cls, size);
|
|
try {
|
|
for (int i = 0; i < arr.length; ++i) {
|
|
arr[i] = cls.newInstance();
|
|
}
|
|
return arr;
|
|
} catch (Exception e) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
}
|