Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-18-2023, 12:57 PM   #1
jj1705
Junior Member
jj1705 began at the beginning.
 
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)
jj1705 is offline   Reply With Quote
Old 10-23-2023, 08:42 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
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 .
NiLuJe is offline   Reply With Quote
Advert
Old 10-23-2023, 08:45 PM   #3
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
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>"
NiLuJe is offline   Reply With Quote
Old 11-14-2023, 10:43 PM   #4
jj1705
Junior Member
jj1705 began at the beginning.
 
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!
jj1705 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 12:32 AM.


MobileRead.com is a privately owned, operated and funded community.