added DateTimeToSQL() and TimeLogToSQL() functions