In android I am using SqlLite with MyDate row like DATETIME DEFAULT CURRENT_TIMESTAMP. But when i am reading date i get date one hour back because i am using GMT + 1 in my android environment.
MyDate: 12:03
Android date: 13:03
When reading from SqlLite how can i convert it to GMT + X, depends on android environment?
EDIT:
code:
Cursor cursor = logsDao.getAll(LogsDao.KEY_ID + " DESC", "100");
String[] columns = new String[] { LogsDao.KEY_CONTENT, LogsDao.KEY_COMMENT, LogsDao.KEY_CREATED };
int[] to = new int[] { R.id.logContext, R.id.logComment, R.id.logCreated };
SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this,
R.layout.log_entry, cursor, columns, to);
setListAdapter(mAdapter);
I suppose that first you should store your retrieved data in a Timestamp with UCT timezone, then update the current Timezone in according with the one of the mobilephone.
You need to implement a custom cursorAdapter and in the method bindView manipuulate your date