MCPcopy
hub / github.com/moment/luxon / toSQL

Method toSQL

src/datetime.js:2034–2040  ·  view source on GitHub ↗

* Returns a string representation of this DateTime appropriate for use in SQL DateTime * @param {Object} opts - options * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. * @param {boolean} [opts.includeOffset=true] - include

(opts = {})

Source from the content-addressed store, hash-verified

2032 * @return {string}
2033 */
2034 toSQL(opts = {}) {
2035 if (!this.isValid) {
2036 return null;
2037 }
2038
2039 return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;
2040 }
2041
2042 /**
2043 * Returns a string representation of this DateTime appropriate for debugging

Callers 1

format.test.jsFile · 0.80

Calls 2

toSQLDateMethod · 0.95
toSQLTimeMethod · 0.95

Tested by

no test coverage detected