forked from LupusNobilis/java-org.hwo
DateTime
parent
ce24c79d8a
commit
a6c657dcc9
|
@ -1,6 +1,8 @@
|
||||||
package org.hwo.datetime;
|
package org.hwo.datetime;
|
||||||
|
|
||||||
|
import java.sql.Time;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
public class DateTime {
|
public class DateTime {
|
||||||
|
|
||||||
|
@ -36,6 +38,13 @@ public class DateTime {
|
||||||
this.date = source.getDate().Clone();
|
this.date = source.getDate().Clone();
|
||||||
this.time = new TimeOfDay(source.getTime());
|
this.time = new TimeOfDay(source.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public DateTime NOW(){
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
Timestamp ts = new Timestamp(calendar.getTimeInMillis());
|
||||||
|
|
||||||
|
return new DateTime(ts);
|
||||||
|
}
|
||||||
|
|
||||||
public int compare(DateTime comp){
|
public int compare(DateTime comp){
|
||||||
int dc = this.date.compare(comp.getDate());
|
int dc = this.date.compare(comp.getDate());
|
||||||
|
|
Loading…
Reference in New Issue