English 中文(简体)
用于 sqlite 的格式日期
原标题:format dates to be used in sqlite
  • 时间:2012-05-22 20:01:54
  •  标签:
  • sqlite

我有一个CSV文件 7万个记录 我需要比较日期

目前储存的如DD/MM/YYYY

我认为,Sqlite要求他们储存YYYY-MM-DD,以便我能使用日期功能。

是否有任何简单的方法可以转换所有这些记录的格式?

非常感谢

最佳回答

Get something like Notepad++/ textpad 并进行搜索和替换 :

Textpad    ([0-9]{2})/([0-9]{2})/([0-9]{4})
Notepad++  ([0-9]{2})/([0-9]{2})/([0-9]{4})

Replace with: 3-2-1 

确保您以正则表达式/扩展搜索重新搜索

问题回答

您是否尝试过 strftime (%Y-%m-%d, colName here) 吗?

更多格式化信息





相关问题
sqlite3 is chopping/cutting/truncating my text columns

I have values being cut off and would like to display the full values. Sqlite3 -column -header locations.dbs " select n.namelist, f.state, t.state from names n left join locations l on l.id = n.id ...

Entity Framework with File-Based Database

I am in the process of developing a desktop application that needs a database. The application is currently targeted to SQL Express 2005 and works wonderfully. However, I m not crazy about having ...

Improve INSERT-per-second performance of SQLite

Optimizing SQLite is tricky. Bulk-insert performance of a C application can vary from 85 inserts per second to over 96,000 inserts per second! Background: We are using SQLite as part of a desktop ...

Metadata for columns in SQLite v2.8 (PHP5)

How can I get metadata / constraints (primary key and "null allowed" in particular) for each column in a SQLite v2.8 table using PHP5 (like mysql_fetch_field for MySql)? sqlite_fetch_column_types (OO:...

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签