×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    How to speak local time?

    I'm trying to make my phone speak the local time, but it's returning an error.

    The code I tried is:

    Code:
    from time import time, localtime, strftime
    
    def time():
    
        time()             
        1135156165.5569999
        localtime()[0:3]  
        (2008, 12, 21)
        localtime()[3:6]   
        (16, 9, 27)
        strftime("%d %b %Y %H:%M:%S", localtime())
        '21 Dec 2008 16:09:27'
    
    audio.say(time)

    The error that returns is:

    Code:
    TypeError: cannot cannot concatenate 'str' and 'function' objects.

    Does someone knows how to fix this?


    Thanks!!!


    BG


    Rafael.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: How to speak local time?

    It's a bit hard to understand your code, but the error has something to do with your trying to "say" a function, instead of a string.
    Your code should be something like:
    Code:
    t=strftime("%d %b %Y %H:%M:%S", localtime())
    audio.say(t)

    And I assume you've seen this article
    Last edited by bogdan.galiceanu; 2008-03-14 at 13:59.

Similar Threads

  1. Date & Time Editor in Form Resource.
    By Kavit Patel in forum Symbian
    Replies: 2
    Last Post: 2008-03-03, 06:26
  2. How does mobile speak provide speak feedback to user ?
    By kimhanh in forum Symbian User Interface
    Replies: 0
    Last Post: 2007-04-20, 03:03
  3. Time Machine for Symbian Series 60 (Alarm, Stopwatch, Timer)
    By kedarchitale in forum General Development Questions
    Replies: 1
    Last Post: 2006-03-30, 20:39
  4. why midlet has been instantiated twice time
    By mraaqibmumtaz in forum Mobile Java General
    Replies: 1
    Last Post: 2006-02-13, 08:17
  5. How to get correct time.
    By dzaga in forum Mobile Java General
    Replies: 2
    Last Post: 2003-08-06, 22:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×