Geekzone: technology news, blogs, forums
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


80 posts

Master Geek

#65262 1-Aug-2010 10:18
Send private message

I'm using Geektool on my Mac to display info about my computer on my desktop, plus some date and time info. I'm trying to find a script that will display a time in hours since a certain time (4.30pm, July 28, 2010).
I don't have any experience with this stuff but I have managed to find a code that can display a time in days;

python -c 'from datetime import *; print (date(2010, 07, 28) -'

Is there any way this can be adjusted for a time in hours?

Create new topic
1 post

Wannabe Geek

  #361298 2-Aug-2010 04:36
Send private message


Try this :

# This script returns the number of hours since a certain date and time

NOW=`date +%s`

echo $(( ($NOW-$REFERENCE_TS) / 3600 ))


Shop Mighty Ape for electronics, games, computers books and more (affiliate link).

80 posts

Master Geek

  #362740 4-Aug-2010 07:05
Send private message

Yep, that is exactly what I was after. Thanks!

Create new topic

News and reviews »

One New Zealand Extends 3G Switch-off Date
Posted 11-Apr-2024 08:56

Amazon Echo Hub Review
Posted 10-Apr-2024 18:57

Epson Launches New Versatile A4 Desktop Scanners
Posted 10-Apr-2024 15:31

Motorola Mobility Launches New Android Phones in New Zealand
Posted 10-Apr-2024 14:59

Logitech G Unveils the PRO X 60 Gaming Keyboard
Posted 9-Apr-2024 19:01

Logitech Unveils Signature Slim Keyboard and Combo
Posted 9-Apr-2024 13:33

ExpressVPN Launches Aircove Go Portable Router With Built-in VPN
Posted 26-Mar-2024 21:25

Shure MoveMic Review
Posted 25-Mar-2024 12:47

reMarkable 2 Launches at JB Hi-Fi New Zealand
Posted 20-Mar-2024 08:36

Samsung Galaxy S24 Ultra review
Posted 19-Mar-2024 11:37

Google Nest Wifi Pro Review
Posted 16-Mar-2024 11:28

Samsung Galaxy A55 5G and Galaxy A35 5G
Posted 12-Mar-2024 12:41

Cricut EasyPress Mini Zen Blue launches at Spotlight New Zealand
Posted 12-Mar-2024 12:32

Logitech Introduces MX Brio Webcam
Posted 12-Mar-2024 12:24

HP Unveils Broadest Consumer Portfolio of AI-Enhanced Laptops
Posted 3-Mar-2024 18:09

Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.

Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.