-1

我必须将文章从最新到最旧...我创建了一个数据库,其中包含文章的链接和更新日期。数据库中日期的类型应该是什么以及如何从数据库中获取数据按照我上面说的顺序?

无法发布代码.....谢谢您的回复..

4

1 回答 1

0

In many case, the best type for the date is long (or INT in SQLite) for storing UTC millisecond from epoch. With this, you don't have to worry about the time zone difference.

As for how to get the date ordered from the database, since you are using SQLite, when you query the DB, use <your date column name> ASC/DESC for ORDER BY.

于 2013-11-02T10:02:57.710 回答