I am trying to convert timestamp to time ago format, i am getting future time like in 5 hours instead of 1 min ago. My timestamp 1500030220000
. below id my code.
CharSequence timeAgo = DateUtils.getRelativeTimeSpanString(
Long.parseLong(eventlist.gettimestamp()),
System.currentTimeMillis(), DateUtils.SECOND_IN_MILLIS);
holder.timestamp.setText(timeAgo);
in my PHP i am using strtotime to convert datetime to timestamp
date_default_timezone_set('GMT');
$timestamp = strtotime($row["date"])*1000;
when i check the date and time in timestamp converter website
its giving accurate result. but in my app its showing in 5 hours. do need to set any timezone in app ?