Time and date in twrp

bobolinko

Senior Member
Nov 5, 2010
338
64
0
Everett WA
I am not a developer, but I do know a bunch about computers. I do think that the TWRP and CWM programs are loaded as not part of the operating system of the device you are using. It does not know how to find where the date/time is stored since it is usable on many different phones and they all have different flavored systems. Therefore, the default date (when the first date/time) it was available, is what the program uses. That is what is causing the weird dates.

You can make a folder using the correct time/date and move the data to that folder so that you might be able to restore the system to that date/time, and also bypass the amount of backups that the program is allowing you to store. You might keep the older stuff on your computer instead of the phone to relax the amount of data stored on the phone itself.

I do understand the pain of manually having to do the dating, etc. but if the program, TWRP or CWM had to do it for you, the developers would have to make sooooo many different versions it wouldn't be feasible. (think about it!)

Anyway, that's my 2 cents. Take it for what it's worth.
Aloha,
 

se1000

Senior Member
Feb 14, 2011
1,038
395
0
IMHO it's a bug, not sure if it can be fixed. I know on my other phones the time and date in both CWM and TWRP are correct
 

Woody

Retired Admin - Vacationing in Nanda Parbat, neck
Nov 18, 2010
8,846
16,531
0
Immersed in Dark Matter
What I do (I use TWRP) is I set the name of the backup manually before it runs. Something like MyIllusion11413 or MyLiquidRC7122612. So I can keep them named and separate from each other. No time stamp but I've been doing it like this for a long time and seems to work well (for me at least).

MyIllusion11413 (Illusion made on 1/14/13)
MyLiquidRC7122612 (LiquidSmooth RC7 made on 12/26/12)
See what I did there? ^^^

Also NO SPACES in the names. Learned that a long time ago the hard way.
 
Last edited:

wseverin

Senior Member
May 12, 2008
147
155
43
Phoenix
a bash script to set TWRP time with ADB

When I have my phone connected to my PC with adb debugging turned on (a too-frequent setup), I use the following little bash script to do the job for me. This sets the UTC time and date in TWRP to the second.
Code:
#!/bin/bash
adb devices
UT=$(date -u '+%Y.%m.%d-%H:%M:%S')
adb shell date -us $UT
 
  • Like
Reactions: cdurex and fiver5

wseverin

Senior Member
May 12, 2008
147
155
43
Phoenix
I get an error like "could not find tzdata..." with S5 G900F and TWRP 2.8.7.0 - 3.1.0.0.
It seems that to save space the tzdata file is omitted from TWRP. It's not really a problem. Every build of TWRP that I have worked with thinks that it's in U.S. Central Standard Time (CST). So, if you want the TWRP system time to accurately represent the real current time you can either convert your local time to CST and then enter it, or you can enter the UTC time by changing "-s" to "-us".
 
  • Like
Reactions: v00d007

v00d007

Senior Member
Feb 28, 2014
1,339
453
113
It seems that to save space the tzdata file is omitted from TWRP. It's not really a problem. Every build of TWRP that I have worked with thinks that it's in U.S. Central Standard Time (CST). So, if you want the TWRP system time to accurately represent the real current time you can either convert your local time to CST and then enter it, or you can enter the UTC time by changing "-s" to "-us".
Thanks, I'm in Europe though with CET/Berlin... The problem was that I've installed a ported Rom with BTU CSC, but I'd need DBT. After setting the time manually in time/date settings, twrp got it after a while... The last time I had this issue was with a S4 Mini and cm 11. The workaround there was to delete the file "time_daemon", but this time this had no effect.
 

btreu1

Senior Member
May 27, 2009
61
15
0
When I have my phone connected to my PC with adb debugging turned on (a too-frequent setup), I use the following little bash script to do the job for me. This sets the UTC time and date in TWRP to the second.
Code:
#!/bin/bash
adb devices
UT=$(date -u '+%Y.%m.%d-%H:%M:%S')
adb shell date -us $UT
I'm unfamiliar with running bash scripts via adb. I created a bash script like 'XXXX.sh' but I don't know how to execute it. Any chance you could you provide further info?
 

cdurex

Senior Member
Sep 22, 2010
69
16
38
Alajuela
When I have my phone connected to my PC with adb debugging turned on (a too-frequent setup), I use the following little bash script to do the job for me. This sets the UTC time and date in TWRP to the second.
Code:
#!/bin/bash
adb devices
UT=$(date -u '+%Y.%m.%d-%H:%M:%S')
adb shell date -us $UT
This is awesome, thanks! You're a hero! :highfive: :cool: