TeamWin / Team-Win-Recovery-Project

Core recovery files for the Team Win Recovery Project (T.W.R.P) - this is not up to date, please see https://github.com/TeamWin/android_bootable_recovery/
http://twrp.me
1.96k stars 740 forks source link

Wrong time in TWRP #1549

Closed alchokem closed 4 years ago

alchokem commented 4 years ago

TWRP reports the wrong date and time and reflects this incorrect information in the files and folders it creates during backups. Currently, my installation of TWRP thinks it is August 2017. Time and Date can't be changed. My phone (HTC 10 - Oreo v8.0 - Verizon), when not in TWRP recovery reports the correct date and time. This problem can be immediately observed by simply booting into TWRP.

CaptainThrowback commented 4 years ago

What version of TWRP are you using? The 10 should be getting the time offset from /persist, so there's no reason the time should be off. I haven't seen this reported by anyone else.

alchokem commented 4 years ago

3.3.1...Lots of people have reported this problem..I googled before posting here...Lots of reports...no solutions.. I'm in PST and it thinks it is 7:01 AM on Aug 18, 2017. Wow!!!

alchokem commented 4 years ago

Should at least provide the ability for the user to set this info in Settings

CaptainThrowback commented 4 years ago

I haven't seen this posted in the TWRP thread for the 10. Other devices do have this issue because there's nowhere to get the offset from. The 10 isn't one of those devices. Where is the recovery log?

alchokem commented 4 years ago

recovery.log Here you go!!!

alchokem commented 4 years ago

This is the first time I have seen this issue as well and I have been using TWRP on HTC devices (One M8, 10) for several years now

CaptainThrowback commented 4 years ago
I:TWFunc::Fixup_Time: Pre-fix date and time: 1970-01-02--05-24-46
I:TWFunc::Fixup_Time: Setting time offset from file /sys/class/rtc/rtc0/since_epoch
I:TWFunc::Fixup_Time: will attempt to use the ats files now.
I:TWFunc::Fixup_Time: Setting time offset from file /persist/time/ats_2, offset 1502933718344
I:TWFunc::Fixup_Time: Date and time corrected: 2017-08-18--07-00-04

That offset is coming directly from the device. Maybe try deleting the ats* files in /persist/time, boot Android and then go back to TWRP and see if it re-adjusts itself? If the information in the offset file is wrong, there's nothing TWRP can do about it. I'm surprised that it's right in Android, if that's the case.

alchokem commented 4 years ago

OK...Thanks!!! I'll give it a shot an report back.

alchokem commented 4 years ago

CaptainThrowBack...you're a miracle worker!! That took care of it!!! Thanks so much!!

CaptainThrowback commented 4 years ago

Great! Please close this issue.

alchokem commented 4 years ago

Issue closed!!

czerwinski76 commented 1 year ago
I:TWFunc::Fixup_Time: Pre-fix date and time: 1970-01-02--05-24-46
I:TWFunc::Fixup_Time: Setting time offset from file /sys/class/rtc/rtc0/since_epoch
I:TWFunc::Fixup_Time: will attempt to use the ats files now.
I:TWFunc::Fixup_Time: Setting time offset from file /persist/time/ats_2, offset 1502933718344
I:TWFunc::Fixup_Time: Date and time corrected: 2017-08-18--07-00-04

That offset is coming directly from the device. Maybe try deleting the ats* files in /persist/time, boot Android and then go back to TWRP and see if it re-adjusts itself? If the information in the offset file is wrong, there's nothing TWRP can do about it. I'm surprised that it's right in Android, if that's the case.

I can't find these files. Were are they located please ?

My recovery's clock is 2 years late and day and month + time are not the good ones.