Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 13:41, 7 April 2008.

How to compare time

From Forum Nokia Wiki

The below code is useful for comparing two times in python. It can be used to develop an application like customized calendar or alarm clock.

import e32
import time
 
def wait():
  t = list(time.localtime())
  n = time.mktime(t)
  t[3] = t[4] = t[5] = 0
  t[2] += 1
  return time.mktime(t) - n
 
timer=e32.Ao_timer()
w = wait()
while w > 60:
  h = w / 3600
  m = w % 3600 / 60
  s = w % 60
  print "waiting %02d:%02d:%02d ..." % (h, m, s)
  timer.after(s or 60)
  w = wait()
 
timer.after(w)
print "It's time!!"
Related Discussions
Thread Thread Starter Forum Replies Last Post
Debugging apps on Series 40 hughrbeyer Mobile Java General 4 2004-05-04 20:00
Find out which color a specific pixel on the screen has. oe3vsfm4 General Symbian C++ 4 2004-03-22 08:50
7650 OS stability biggar General Symbian C++ 1 2003-03-14 11:43
Insert TIME-Value to DB by SQL-String jensesaat General Symbian C++ 3 2006-12-20 11:42
6600 and opera cobbler1701 General Symbian C++ 11 2004-03-20 00:55
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZpythonQ
     qfnZtopicQUqfnTopicZseriesE5f60Q
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX