android - datetime ('now' ) 给出了错误的时间

标签 android sqlite datetime

我的 Android 模拟器的系统时间是正确的(当前是 13:42)。但是当我使用 datetime('now') 函数在我的 SQLite 数据库中设置当前时间时,返回值是错误的 (11:42)。

我还需要设置其他时间才能使其正常工作吗?

最佳答案

datetime('now') 的返回值是 UTC。

尝试

datetime('now', 'localtime')

关于android - datetime ('now' ) 给出了错误的时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6087691/

相关文章:

java - 如何使用 Google Fitness API 获取特定时间的步数?

android - 是否可以在 Android 应用程序中嵌入 Google 导航?

cakephp - 错误: Database connection "Sqlite" is missing,或无法创建Cakephp 2.9.0

android - 如何使用字符串变量而不是整数在 SQLite 数据库中进行搜索?

python - python 中日期时间的时区转换不正确

php - 我应该使用什么格式在 MySQL 表中存储用户的首选时区?

c# - DateTime.ToString 格式

Android OpenCV VideoCapture::retrieve(&mat) 导致致命信号 11

android - 如何从 Activity 中停止 START_STICKY android 服务

sqlite - 在 SQLite 中使用乱序词在数据库中搜索