Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
keep milliseconds when converting date objects to a SQL-friendly format
Browse files Browse the repository at this point in the history
  • Loading branch information
lafave committed Apr 7, 2015
1 parent e19239b commit 4cd5200
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sequel/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,14 @@ utils.escapeString = function(value) {
*/

utils.toSqlDate = function(date) {
return date.toUTCString();
utc = new Date(
date.getUTCFullYear(),
date.getUTCMonth(),
date.getUTCDate(),
date.getUTCHours(),
date.getUTCMinutes(),
date.getUTCSeconds(),
date.getUTCMilliseconds()
);
return utc.toISOString();
};

0 comments on commit 4cd5200

Please sign in to comment.