Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor keerthi.ck06's Avatar
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    174
    hi friends i'm trying to create fake sms in my inbox folder i can able to create successfully but the problem is i'm not able to set the date of the sms. i dont want to set the date to current date i want to set like 01-01-2000. any body please help me. i want 2 things that are.

    1. i know how to read the date, after reading i want save this into a file.


    is this right..

    TInt64 date=entry1.iDate.Int64();
    i'm saving this int valuse.

    2. using above saved date i want to set the date.

    while setting i'm using the above int value to set the date, like this is this correct..

    TTime time(date);
    entry.iDate=time;

    but this is not working...


    this is the code i'm using..i tried everything but no use.. please help me...

    TInt TimeInt;
    TLex tlex(aTime);
    tlex.Val(TimeInt);
    TTime time(TimeInt);
    iSmsMtm->SwitchCurrentEntryL( aFolderId );
    iSmsMtm->CreateMessageL( KUidMsgTypeSMS.iUid );

    CMsvStore* aMessageStore = iSmsMtm->Entry().EditStoreL();
    CleanupStack::PushL( aMessageStore );
    CleanupStack::PopAndDestroy( aMessageStore );

    CRichText& body = iSmsMtm->Body();
    body.Reset();
    body.InsertL( 0, aMsgText );

    TMsvEntry entry = iSmsMtm->Entry().Entry();
    entry.SetInPreparation( EFalse );
    entry.SetVisible( EFalse );
    //entry.iDate=time;

    entry.iDate.UniversalTime();// i dont want this , i want to set my own date like 01-01-2000

    // TTime msgTime;
    // msgTime.UniversalTime();
    // entry.iDate.HomeTime();
    entry.iDescription.Set( aDescription );
    entry.iDetails.Set( aAddress );
    entry.SetUnread( EFalse );

    iSmsMtm->Entry().ChangeL(entry);
    iSmsMtm->SaveMessageL();

    i want to know two things, how to save the save and using that saved value how to set...

  2. #2
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    what happens when you assign your TTime to iDate ?

    i want to set my own date like 01-01-2000
    What does that mean, is that you want a specific format ? Or you want your TTime to be set.

  3. #3
    Nokia Developer Champion savaj's Avatar
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034
    From where you get value of time in entry1.iDate ???

    You can also set it manually as:

    _LIT(KDate,"20000000:"); // 01 january 2000.
    TBuf <24> Date =KDate;
    TInt err=time.Set(Date);

  4. #4
    Regular Contributor keerthi.ck06's Avatar
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    174
    i want to set my TTime to my own date..

  5. #5
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    then again what happens
    what happens when you assign your TTime to iDate ?
    also make sure you are passing correct TTime.

  6. #6
    Regular Contributor keerthi.ck06's Avatar
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    174
    thanks for ur replies skumar_rao and savaj...

    if i assign my TTime to iDate its setting to current time...

    while saving i'm dooing like this...
    TInt64 date=entry1.iDate.Int64();
    i'm saving this int valuse.

    while setting TTime i'm doing this..
    TTime time(date);
    entry.iDate=time;

    but what's wrong this and how can save and reset again any sample code for saving and setting..

  7. #7
    Nokia Developer Champion savaj's Avatar
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034
    Quote Originally Posted by keerthi.ck06 View Post
    i want to set my TTime to my own date..
    Did not get you.

    Quote Originally Posted by keerthi.ck06
    if i assign my TTime to iDate its setting to current time...

    while saving i'm dooing like this...
    TInt64 date=entry1.iDate.Int64();
    i'm saving this int valuse.

    while setting TTime i'm doing this..
    TTime time(date);
    entry.iDate=time;

    but what's wrong this and how can save and reset again any sample code for saving and setting..
    entry1.iDate have correct time in it???

  8. #8
    Regular Contributor keerthi.ck06's Avatar
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    174
    thank you friends this is working fine..

    _LIT( KFormatDate, "%d%+02d%+02d:%+02d%+02d%+02d.%+06d");
    TBuf<30> bufTime;
    TTime time;
    time.HomeTime();
    TDateTime datetime = time.DateTime();
    bufTime.Format( KFormatDate, datetime.Year(),
    datetime.Month(), datetime.Day(),
    datetime.Hour(), datetime.Minute(),
    datetime.Second(), datetime.MicroSecond());

    and

    TTime time;
    TInt err=time.Set(bufTime);

  9. #9
    Regular Contributor decryptor's Avatar
    Join Date
    Jun 2005
    Posts
    52
    Quote Originally Posted by keerthi.ck06 View Post
    thank you friends this is working fine..

    _LIT( KFormatDate, "%d%+02d%+02d:%+02d%+02d%+02d.%+06d");
    TBuf<30> bufTime;
    TTime time;
    time.HomeTime();
    TDateTime datetime = time.DateTime();
    bufTime.Format( KFormatDate, datetime.Year(),
    datetime.Month(), datetime.Day(),
    datetime.Hour(), datetime.Minute(),
    datetime.Second(), datetime.MicroSecond());

    and

    TTime time;
    TInt err=time.Set(bufTime);
    hi
    you said its working already
    did you still used this in your code?

    entry.iDate.Set(bufTime);

    did your SMS sent on the date time you specified? im working on it but still the message i created remains in the outbox even when the time i set came..nothing happens
    hope to hear from you regarding this
    thanks in advance

  10. #10
    Regular Contributor keerthi.ck06's Avatar
    Join Date
    Dec 2008
    Location
    Bangalore
    Posts
    174
    hi friend i was just setting the sms time thats all i was not sending the sms.. anyways did you check setting date is proper..

  11. #11
    Super Contributor mayankkedia's Avatar
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146
    Quote Originally Posted by decryptor View Post
    hi
    you said its working already
    did you still used this in your code?

    entry.iDate.Set(bufTime);

    did your SMS sent on the date time you specified? im working on it but still the message i created remains in the outbox even when the time i set came..nothing happens
    hope to hear from you regarding this
    thanks in advance
    If at all you want to send sms at a pre-defined time, you can have a callback mechanism which would notify you when the time happens,at which time you can create and send your sms. You would get links to pretty much all the parts of it on the Wiki.
    Cheers,
    Mayank

Similar Threads

  1. Displaying Current date time in SMS??
    By arunjadhav_v in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2005-08-13, 12:22
  2. Displaying current date on sms
    By arunjadhav_v in forum General Messaging
    Replies: 0
    Last Post: 2005-07-30, 13:15
  3. Replies: 0
    Last Post: 2005-03-31, 14:15
  4. Use Sim Service Set or Sms Service set for SMS access
    By mkroll in forum Multimodecards
    Replies: 3
    Last Post: 2003-05-12, 09:21
  5. Replies: 1
    Last Post: 2003-05-06, 09:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved