![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Oct 2023
Device: Kindle4
|
Kindle4 "Date -d" use?
For the life of me, I can't seem to get the date command to work with either the -d or --date arguments to give me the epoch time for a future date. Do I need a new version of the date binary? I'm guessing the version of the binary on the kindle doesn't support this argument?
This works: TODAY=$(date +"%Y-%m-%d") CURRENT_TIME=$(date +%s) These just return a blank string: TMP_A=$(date +%s -d "Fri Apr 24 13:14:15 2023") TMP_B=$(date +%s -d "2023-10-17 06:00") TMP_C=$(date -d "tomorrow 06:00" +"%s") TMP_D=$(date -d "Oct 21 1973" +'%s') TMP_E=$(date +%s -d "Fri Apr 24 13:14:39 CDT 2009") TMP_F=$(date --date "today 17:00" +%s) |
![]() |
![]() |
![]() |
#2 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
The fancier native language ones are definitely not supported, but the basics *ought* to work.
c.f., https://git.busybox.net/busybox/tree...ls/date.c#n113 I haven't double-checked on a device, but this code seems to have been in there for a while, so there's a chance it made it into the prehistoric busybox version shipped on a K4 ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
i.e., on a sane busybox version, the only variant accepted would be the one from `TMP_B`, the rest reports "invalid date: <blah>"
|
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Oct 2023
Device: Kindle4
|
Thanks. I'll have to check it out, but last time I ran that code, all of those TMP variables just returned a blank string. I can see the line of code you referenced so I can tinker some more.
TBH, I hit my head against the wall enough times than I took a break for my own sanity! ![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sort by "Date" does not equal import date? | gandoe | Library Management | 7 | 12-08-2019 08:00 AM |
Bugs "Sanity Check epub" and "Failed Release date" on V 0.91 | qkiazd | Sigil | 5 | 12-03-2015 04:01 AM |
upgraded, previously "special offers" screensavers kindle4 | er0ck | Kindle Developer's Corner | 2 | 05-02-2013 03:49 PM |
Editing "date" on a "News" tagged ebook makes it vanish... | jangliss | Calibre | 4 | 12-04-2011 10:12 PM |
Custom column: "Updated date", when adding new "versions" of the same file? | enriquep | Library Management | 16 | 11-03-2011 10:46 AM |