From 08dfdf1434d741a736511a32c5dd4821cacf027f Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Tue, 28 Apr 2015 23:06:40 +0000 Subject: [PATCH] Fix os.time() conversions for pm times. --- README.html | 1 + src/core/org/luaj/vm2/lib/OsLib.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.html b/README.html index b81bc9c2..cd0f790a 100644 --- a/README.html +++ b/README.html @@ -1015,6 +1015,7 @@ and at http://luaj.sour
  • Add sample code that illustrates techniques in creating sandboxed environments.
  • Add convenience methods to Global to load string scripts with custom environment.
  • Move online docs to http://luaj.org/luaj/3.0/api/
  • +
  • Fix os.time() conversions for pm times.
  • diff --git a/src/core/org/luaj/vm2/lib/OsLib.java b/src/core/org/luaj/vm2/lib/OsLib.java index c55d119d..b89ec6e9 100644 --- a/src/core/org/luaj/vm2/lib/OsLib.java +++ b/src/core/org/luaj/vm2/lib/OsLib.java @@ -494,7 +494,7 @@ public class OsLib extends TwoArgFunction { c.set(Calendar.YEAR, table.get("year").checkint()); c.set(Calendar.MONTH, table.get("month").checkint()-1); c.set(Calendar.DAY_OF_MONTH, table.get("day").checkint()); - c.set(Calendar.HOUR, table.get("hour").optint(12)); + c.set(Calendar.HOUR_OF_DAY, table.get("hour").optint(12)); c.set(Calendar.MINUTE, table.get("min").optint(0)); c.set(Calendar.SECOND, table.get("sec").optint(0)); c.set(Calendar.MILLISECOND, 0);