toSQL() or fromSQL() not compliant with DATETIME #1309
Answered
by
icambron
femto-code
asked this question in
Q&A
-
As stated here (https://dev.mysql.com/doc/refman/8.0/en/datetime.html) the specification for SQL requires the format (YYYY-MM-DD hh:mm:ss) to comply with the DATETIME data type. However, luxons SQL-related functions don't seem to produce that format, is that correct? Should I go with toFormat then? |
Beta Was this translation helpful? Give feedback.
Answered by
icambron
Oct 20, 2022
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
femto-code
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DateTime.now().toSQL({ includeOffset: false } )
should be what you want. The issue is only that MySQL doesn't accept the offset