Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect date-time on android #4053

Closed
AidanHost opened this issue Aug 5, 2020 · 2 comments · Fixed by #4055
Closed

incorrect date-time on android #4053

AidanHost opened this issue Aug 5, 2020 · 2 comments · Fixed by #4055
Labels
type: bug New bug report

Comments

@AidanHost
Copy link
Contributor

AidanHost commented Aug 5, 2020

Hi guys,

sorry, not really setup to create a pull request here, but there is a bug in the SharedUtils.java file

timestamp is seconds since Epoch https://firebase.google.com/docs/reference/android/com/google/firebase/auth/GetTokenResult#getExpirationTimestamp()

Date date = new Date((timestamp + calendar.getTimeZone().getOffset(timestamp)) * 1000);

the calendar.getTimeZone().getOffset(timestamp) call returns milliseconds, so it should be excluded from the * 1000 calculation

Java docs: https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html#getOffset(long)

@mikehardy
Copy link
Collaborator

Fantastic bug report. I went 🤠 and just created a PR based directly on this report, using the web UI 🤞

mikehardy added a commit that referenced this issue Aug 5, 2020
@mikehardy
Copy link
Collaborator

should be in the next release and...I'm not 100% but I think it might be set up for semver and auto-launch so, be on the lookout

androidIsForVivek pushed a commit to androidIsForVivek/react-native-firebase that referenced this issue Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug New bug report
Projects
None yet
3 participants