안드로이드 개발 질문/답변
(글 수 45,052)
SMS를 받아서 db에 넣고 다시 listview로 뿌려주는 어플리케이션을 개발하고있는데요
current_timestamp를 썻는데 시간이 9시간 가량 느리게 찍히네요
이부분을 어떻게 처리해야 하는지 알려주시면 감사하겠습니다.
mDB.execSQL("create table if not exists
msg_table (_id integer primary key autoincrement,
key text not null,
name text not null,
msg text not null,
date datetime default current_timestamp);");
http://stackoverflow.com/questions/381371/sqlite-current-timestamp-is-in-gmt-not-the-timezone-of-the-machine
를 참고하시면 되는데 폰이라는게 다른 나라를 오갈수도 있기때문에 로직을 gmt 기준으로 구성하고 디스플레이 할때 local time으로 변환하는게 좋지 않을까 생각됩니다.