01: package org.ontoware.semversion.impl;
02:
03: import java.util.Date;
04:
05: @Deprecated
06: public class DateUtils {
07:
08: public static Date asDate(long l) {
09: return new Date(l);
10: }
11:
12: public static long asLong(Date d) {
13: return d.getTime();
14: }
15:
16: public static long asLong(String s) {
17: assert s != null;
18: try {
19: return Long.parseLong(s);
20: } catch (NumberFormatException e) {
21: throw new RuntimeException(e);
22: }
23: }
24:
25: public static Date asDate(String s) {
26: return asDate(asLong(s));
27: }
28:
29: }
|