diff options
author | Carsten Weisse <[email protected]> | 2004-07-14 15:34:24 +0000 |
---|---|---|
committer | Carsten Weisse <[email protected]> | 2004-07-14 15:34:24 +0000 |
commit | e45462dfe3f3db94bf9668d294794c27909a522f (patch) | |
tree | 93421e1b0d83de4ce25d3222e969b619962d9087 | |
parent | 60f18a1c68322d078d3217710bf2a3d05678ecf8 (diff) |
deprecated java.util.Date replaced
-rw-r--r-- | src/jake2/game/GameMiscAdapters.java | 8 | ||||
-rw-r--r-- | src/jake2/server/SV_CCMDS.java | 12 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/jake2/game/GameMiscAdapters.java b/src/jake2/game/GameMiscAdapters.java index 56aba1a..cfbe2e4 100644 --- a/src/jake2/game/GameMiscAdapters.java +++ b/src/jake2/game/GameMiscAdapters.java @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 26.02.2004 by RST. -// $Id: GameMiscAdapters.java,v 1.2 2004-07-08 20:24:29 hzi Exp $ +// $Id: GameMiscAdapters.java,v 1.3 2004-07-14 15:34:24 cawe Exp $ package jake2.game; @@ -29,7 +29,7 @@ import jake2.client.M; import jake2.util.Lib; import jake2.util.Math3D; -import java.util.Date; +import java.util.Calendar; public class GameMiscAdapters { @@ -878,8 +878,8 @@ public class GameMiscAdapters } else { - Date d = new Date(); - self.message = "" + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds(); + Calendar c = Calendar.getInstance(); + self.message = "" + c.get(Calendar.HOUR_OF_DAY) + ":" + c.get(Calendar.MINUTE) + ":" + c.get(Calendar.SECOND); /* struct tm * ltime; diff --git a/src/jake2/server/SV_CCMDS.java b/src/jake2/server/SV_CCMDS.java index 76e348d..f890cab 100644 --- a/src/jake2/server/SV_CCMDS.java +++ b/src/jake2/server/SV_CCMDS.java @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 18.01.2004 by RST. -// $Id: SV_CCMDS.java,v 1.3 2004-07-09 06:50:49 hzi Exp $ +// $Id: SV_CCMDS.java,v 1.4 2004-07-14 15:34:24 cawe Exp $ package jake2.server; @@ -32,7 +32,7 @@ import jake2.util.Lib; import jake2.util.Vargs; import java.io.*; -import java.util.Date; +import java.util.Calendar; public class SV_CCMDS extends SV_ENTS { @@ -433,11 +433,15 @@ public class SV_CCMDS extends SV_ENTS { if (!autosave) { //time( aclock); //newtime = localtime( aclock); - Date newtime = new Date(); + Calendar c = Calendar.getInstance(); comment = Com.sprintf( "%2i:%2i %2i/%2i ", - new Vargs().add(newtime.getHours()).add(newtime.getMinutes()).add(newtime.getMonth() + 1).add(newtime.getDay())); + new Vargs() + .add(c.get(Calendar.HOUR_OF_DAY)) + .add(c.get(Calendar.MINUTE)) + .add(c.get(Calendar.MONTH) + 1) + .add(c.get(Calendar.DAY_OF_MONTH))); comment += sv.configstrings[CS_NAME]; } else { // autosaved |