Hi,
I have created a Setting List in my application following the link
http://wiki.forum.nokia.com/index.php/Settings_Lists
I have a Time editor in the Setting List.
Once the time is set in the setting list,my app performs a comparison between the set time and current time.
Say the time set was 3.52 PM
The comparison is done as follows:-
The output is as follows:-Code:TTime now; TTime settingTime; settingTime = iSleepSettingsData->SettingTime(); now.HomeTime(); HBufC* timeFormatString = NULL; TBuf<50> timeString; timeFormatString = CEikonEnv::Static()-> AllocReadResourceLC(R_QTN_TIME_USUAL); now.FormatL(timeString,*timeFormatString); RDebug::Printf("Present time:"); RDebug::Print(timeString); settingTime.FormatL(timeString,*timeFormatString); RDebug::Printf("Setting time:"); RDebug::Print(timeString); TTimeIntervalHours minDiff; now.HoursFrom(settingTime, minDiff); RDebug::Print(_L("Current time is %d hours ahead from set time ////////////////////////////"),minDiff.Int()); if(now.operator ==(settingTime)){ RDebug::Printf("The comparison succeeded"); }else{ RDebug::Printf("The comparison failed"); }
Present time:
5:57 pm
Setting time:
3:52 pm
Current time is 17619842 hours ahead from set time ////////////////////////////
The comparison failed
Kindly someone please tell me why it gives such an absurd number of hours when the difference is just 2.
Should i convert the TTime received from the setting list to some other format.What is being done wrong...
Plz Help!!!
Regards
Biju Chandran

Reply With Quote

