summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mysql.sml7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mysql.sml b/src/mysql.sml
index 77f95f8d..75c48b9a 100644
--- a/src/mysql.sml
+++ b/src/mysql.sml
@@ -666,7 +666,7 @@ fun p_getcol {loc, wontLeakStrings = _, col = i, typ = t} =
string ";",
newline,
newline,
- string "struct tm t = {mt->second, mt->minute, mt->hour, mt->day, mt->month, mt->year, 0, 0, -1};",
+ string "struct tm t = {mt->second, mt->minute, mt->hour, mt->day, mt->month-1, mt->year, 0, 0, -1};",
newline,
string "mktime(&t);",
newline,
@@ -1046,7 +1046,10 @@ fun queryPrepared {loc, id, query, inputs, cols, doCols, nested} =
string ": error converting to MySQL time\");",
newline,
oneField "year" "year",
- oneField "month" "mon",
+ box [string "in_buffer",
+ string (Int.toString i),
+ string ".month = tms.tm_mon + 1;",
+ newline],
oneField "day" "mday",
oneField "hour" "hour",
oneField "minute" "min",