Uncategorized

mysql how to ignore error doesn’t have a default value

This is caused by the STRICT_TRANS_TABLES SQL mode defined in the MySQL my.ini file. Removing that setting and restarting MySQL should fix the problem, or, get into the mysql command and: select @@GLOBAL.sql_mode +——————————————–+ | @@GLOBAL.sql_mode | +——————————————–+ | STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION | +——————————————–+ 1 row in set (0.00 sec) Then do: mysql> set GLOBAL sql_mode=’NO_ENGINE_SUBSTITUTION’;

Uncategorized

javascript add more days to datetime

function incrementDate(date_str, incrementor) { var parts = date_str.split(“-“); var dt = new Date( parseInt(parts[0], 10), // year parseInt(parts[1], 10) – 1, // month (starts with 0) parseInt(parts[2], 10) // date ); dt.setTime(dt.getTime() + incrementor * 86400000); parts[0] = “” + dt.getFullYear(); parts[1] = “” + (dt.getMonth() + 1); if (parts[1].length < 2) { parts[1] =… Continue reading javascript add more days to datetime