×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Nov 2004
    Location
    INDIA
    Posts
    84

    time difference conversion

    hi,
    i am using ttime to find the current time.
    ttime a;
    a.hometime();
    after sometime i am declaring another ttime
    ttime b;
    b.hometime();
    i want to find difference between this two ttime.

    i tried with microsecondsfrom b.but i am unable to use this function and get the correct output.
    i also tried with secondsfrom function.i need the time difference between the two time in seconds or microseconds and convert into TINT.is it possible to convert into TINT.anybody help me to solve this problem.i need an example to use these functions.

    rgds,
    mani

  2. #2
    Nokia Developer Expert
    Join Date
    Apr 2003
    Location
    Finland
    Posts
    425
    Hi

    Code:
    	TTime a,b;
    	a.HomeTime();
    	b.HomeTime();
    	TTimeIntervalSeconds difference;
    	TInt err = b.SecondsFrom(a, difference);
    	if (err == KErrNone)
    	{
    		TInt seconds = difference.Int();
    		// TODO: use seconds
    	}
    	else
    	{
    		// TODO: error handling
    	}
    Br V

Posting Permissions

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