Posts: 1 | Thanked: 1 time | Joined on Mar 2013
#1
I wan't to use the "date" function in lxterminal to do time calculations
example: today +2 days = 3/30/13
this is the command as used in Debian GNU/Linux 5.0.8 (lenny): "% date --date="today + 2 days"
Sat Mar 30 04:04:40 CDT 2013
when I try the above I get "-date option not reconized"
also is there a special reference for commands that are diffirent from the mainstream debian?, I know how to install the man-deb-n900 but I don't wan't to add dev-extra repo.
 

The Following User Says Thank You to andrewrz For This Useful Post:
Posts: 1,992 | Thanked: 3,339 times | Joined on Jun 2010 @ N900: Battery low. N950: torx 4 re-used once and fine; SIM port torn apart
#2
Quick reply...
In its shell, Maemo uses Busybox to supply much of these commands. Since busybox is light, and its Maemo-5 version is out-of-date, the "date" command has usage:
date [OPTION] ... [MMDDhhmm[[CC]YY][.ss]] [+FORMAT]
And when you compare it with
date [OPTIONS] [+FMT] [TIME]
you will see that default Maemo version of 'date' doesn't seem to accept 'today' as TIME.
You can use 'date' to get time-and-date. You can use 'date -Idate' to get date only ("-I[SPEC] Output ISO-8601 compliant date string"). But I haven't seen any way to calculate 'today+2days'.
Best wishes. May you find what I could not.
_________________
Per aspera ad astra...
 
peterleinchen's Avatar
Posts: 4,088 | Thanked: 8,804 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#3
You could try to handle that with unix time in seconds
$(($(date +%s)+2*86400))
--edit
And even there is no one-poster-response ,
here is the full command:
Code:
date -D %s -d $(($(date +%s)+2*86400))
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2013-04-03 at 08:31.
 

The Following 3 Users Say Thank You to peterleinchen For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 07:30.