×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    14

    2 TTime difference in seconds

    I have 2 TTime

    TTime start;
    TTime end;


    they represent the start of the ringing of the mobile till it end ringing
    I need to get the difference between this 2 TTime in seconds , i.e 10 sec or 70 sec ... and so on according to the length of the ring

    my code is

    Code:
    start.HomeTime();
    
    --- when ring ends --
    
    end.HomeTime();
    end.SecondsFrom(start,diffSeconds);

    I tried to show the value of diffSeconds

    Code:
    TBuf<50> difference;
    difference.Num(diffSeconds.Int());

    but for example if it's 3 seconds length , I get difference = 6298728 not 3

    so what is the problem ?

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,692

    Re: 2 TTime difference in seconds

    Also check the return value, there may be an error code.

  3. #3
    Registered User
    Join Date
    Jun 2010
    Posts
    14

    Re: 2 TTime difference in seconds

    I don't think so , as the return value vary as the length of the ring vary

    so when the ring length is 10 sec the return is not like the return when the ring is 20

    they all start with 63 or 62 and 4 more digits

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,692

    Re: 2 TTime difference in seconds

    Set diffSeconds to 0 prior to the SecondsFrom call. To see if it remains to be 0.

  5. #5
    Registered User
    Join Date
    Jun 2010
    Posts
    14

    Re: 2 TTime difference in seconds

    yes , when I set it to 0 , it remains to be 0 whatever the ring length is

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,692

    Re: 2 TTime difference in seconds

    Now, after a day you could consider checking the return value. When there is an error, the output argument remains untouched, so what you saw was some random value from the stack.

  7. #7
    Registered User
    Join Date
    Jun 2010
    Posts
    14

    Re: 2 TTime difference in seconds

    sorry today is the start of the week-end in my country

  8. #8
    Registered User
    Join Date
    Jun 2010
    Posts
    14

    Re: 2 TTime difference in seconds

    ok , thank you very much for your help

    I needed to change where I declare TTime start;

Similar Threads

  1. Last 3 seconds in WAV file
    By jawadakhtar in forum Audio
    Replies: 0
    Last Post: 2009-10-09, 14:19
  2. Displaying the alert in 3 seconds
    By sweetsweet24 in forum Mobile Java General
    Replies: 5
    Last Post: 2009-05-13, 08:37
  3. Waiting in Seconds
    By magindia in forum Symbian
    Replies: 5
    Last Post: 2009-01-04, 14:25
  4. Show baloon for 5 seconds, disapear for 3 seconds, apear again in 5 seconds
    By RAiNMAKER in forum [Archived] Flash Lite on Nokia Devices
    Replies: 3
    Last Post: 2008-10-14, 07:00
  5. How to calculate audio data's length in seconds
    By eekisa in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-05-14, 02:29

Posting Permissions

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