Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要有关如何将 EDT 日期格式的字符串 [ Fri Jun 19 10:45:39 EDT 2009 ] 转换回 SQL 中的 Date 的帮助(我正在使用 Postgres)。我希望能够拥有这样的东西 19-06-2009
谢谢
SELECT CAST('Fri Jun 19 10:45:39 EDT 2009' AS date), -- to get datatype DATE TO_CHAR(CAST('Fri Jun 19 10:45:39 EDT 2009' AS date), 'DD-MM-YYYY') -- formated date, a string