A
A
Anton Osipov2016-10-15 22:40:02
Java
Anton Osipov, 2016-10-15 22:40:02

What is the reason for Calendar not working correctly?

Date d = new Date(this.DateOn);
Calendar c = Calendar.getInstance();
c.setTimeZone(TimeZone.getTimeZone("Asia/Yekaterinburg"));
c.setTime(new Date(this.DateOn));
Log.v("Date", this.DateOn+" - "+c.get(Calendar.MONTH)+"."+c.get(Calendar.DAY_OF_MONTH));
We get in the logs:
10-16 00:28:17.342 31301-31301/osipov.surpg V/Date: 1477020600 - 0.18

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Osipov, 2016-10-15
@tohaosipow

Answer found: need Timestamp *1000L

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question