我正在通过我的 ActiveRecord 将一些字符串(看起来像日期)插入到 sqlite3 数据库中,并且数据库正在更改该字段并使其看起来像一个日期。例如:
"4-2" => "2-Apr" #Not only a date but the order has been reversed.
"6-7-12" => "7/12/2006" #Again not only a date but the order has been changed.
我寻找了一个 ruby 字符串函数,它可以防止这种情况发生,但无法提出任何建议。
有没有其他人遇到过这样的事情,您是否知道任何解决方法或修复。