Active Topics

 


Reply
Thread Tools
Posts: 35 | Thanked: 1 time | Joined on Dec 2009
#1
Hello,

is there any "days since" or "time since" or "time counter" application available?

thanks

Larry
 
Posts: 840 | Thanked: 823 times | Joined on Nov 2009
#2
Originally Posted by tangigi View Post
Hello,

is there any "days since" or "time since" or "time counter" application available?

thanks

Larry
Not sure about an app but if you know how to use the commandline you could try my script. Note that it's written for bash.

Code:
#!/bin/bash

CURRENT=$(date -u '+%F %T.%N %Z')
PAST=$(date -u -d"$1" '+%F %T.%N %Z')

MPHR=60
HPD=24

secondsdiff () {
        printf '%s' $(( $(date -u -d"$CURRENT" +%s) - $(date -u -d"$PAST" +%s)))
}

DAYS=$(( $(secondsdiff) / $MPHR / $MPHR / $HPD ))
CURRENT=$(date -d"$CURRENT -$DAYS days" '+%F %T.%N %Z')
HOURS=$(( $(secondsdiff) / $MPHR / $MPHR ))
CURRENT=$(date -d"$CURRENT -$HOURS hours" '+%F %T.%N %Z')
MINUTES=$(( $(secondsdiff) / $MPHR ))
CURRENT=$(date -d"$CURRENT -$MINUTES minutes" '+%F %T.%N %Z')
printf '%s days, %s hours, ' "$DAYS" "$HOURS"
printf '%s minutes, and %s seconds ' "$MINUTES" "$(secondsdiff)"
printf 'since %s!\n\n' "$PAST"
you just give it a date on the command line and it will tell you how many days and time since.

Last edited by Cue; 2011-02-17 at 20:39.
 

The Following 2 Users Say Thank You to Cue For This Useful Post:
pelago's Avatar
Posts: 2,121 | Thanked: 1,540 times | Joined on Mar 2008 @ Oxford, UK
#3
Originally Posted by tangigi View Post
Hello,

is there any "days since" or "time since" or "time counter" application available?

thanks

Larry
There's at least once countdown desktop widget. I'm not sure if it can be configured to count up rather than down, but if it can't, it might be worth asking the author.
 
Posts: 411 | Thanked: 195 times | Joined on May 2010 @ Cambridge, UK
#4
Sounds like it could be a nice simple app for a first project... Hmmm....
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#5
For busybox something like this

Code:
expr \( $(date +%s) - $(date +%s -d $PAST) \) / 86400
should do it, where $PAST is in [MMDDhhmm[[CC]YY][.ss]] format (ie 021700002011 for today).
 

The Following User Says Thank You to lma For This Useful Post:
Posts: 136 | Thanked: 115 times | Joined on Jul 2010 @ Greece
#6
You reminded me of this I had some time ago on N810
http://maemo.org/packages/view/countdown-home/
and I see it is also available now for N900.
worth checking out.
 
Posts: 35 | Thanked: 1 time | Joined on Dec 2009
#7
Thanks for the info.

sometimes I forget how long it has been since I last changed my car battery or my water filter in my ref, etc.

I do use days since app in igoogle. but having it mobile would be excellent

Last edited by tangigi; 2011-02-18 at 05:49.
 
Posts: 145 | Thanked: 54 times | Joined on Feb 2011 @ Finland
#8
Originally Posted by tangigi View Post
Thanks for the info.

sometimes I forget how long it has been since I last changed my car battery or my water filter in my ref, etc.

I do use days since app in igoogle. but having it mobile would be excellent
or you could just write the date with a white magic marker on the side of the battery like i do works also with timing belt etc. :P
 
Posts: 35 | Thanked: 1 time | Joined on Dec 2009
#9
Originally Posted by KetkuFIN View Post
or you could just write the date with a white magic marker on the side of the battery like i do works also with timing belt etc. :P
I do that too, but I end up remembering when my car won't start.
 
Reply


 
Forum Jump


All times are GMT. The time now is 01:49.