×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Brebes, Indonesia
    Posts
    129

    Problem get 2 digit day and month

    Please help me.
    I have one problem when accessing 2 digit day and month in symbian.
    this my code
    TTime iTime;
    iTime.HomeTime();
    TBuf<> aDay;
    TBuf<2> aMonth;

    iTime.FormatL(aDay, _L("%D"));
    iTime.FormatL(aMonth, _L("%M"));
    whit the code i want to get 2 digit day and month, but i can't do them.
    Thanks for respons
    http://blogehendrawan.blogspot.com - Kembangin symbian di Indonesia yukk....

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Smile Re: Problem get 2 digit day and month

    Hi,

    Refer to the following link:
    http://discussion.forum.nokia.com/fo...ad.php?t=94137

    Ok. Do it something like this:
    Code:
        _LIT( KTimeFormat, "%D%M%Y%1-%2-%3" );
        TTime time;
        time.HomeTime();
        TBuf<30> TimeDesc;
        	
        TRAPD( err, time.FormatL( TimeDesc, KTimeFormat) );
        CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
        informationNote->ExecuteLD(TimeDesc);
    Regards.
    Kiran.
    Last edited by kiran10182; 2006-12-04 at 04:31.

  3. #3
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Brebes, Indonesia
    Posts
    129

    Re: Problem get 2 digit day and month

    Thanks for respons. But with your code i still can't get day and month.
    http://blogehendrawan.blogspot.com - Kembangin symbian di Indonesia yukk....

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Exclamation Re: Problem get 2 digit day and month

    Hi,
    Quote Originally Posted by hendrawan.ashari
    Thanks for respons. But with your code i still can't get day and month.
    It will show you in the format: 04-12-2006

    What do you want exactly?
    Please write down your format here.

    Regards.
    Kiran.

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Smile Re: Problem get 2 digit day and month

    Hi,
    Quote Originally Posted by hendrawan.ashari
    Thanks for respons. But with your code i still can't get day and month.
    Ok. You can try out with following formats.
    _LIT( KDayFormat, "%D%1" );
    _LIT( KMonFormat, "%M%2" );
    Regards.
    Kiran.

  6. #6
    Super Contributor
    Join Date
    Jul 2006
    Location
    Oulu, Finland.
    Posts
    1,174

    Re: Problem get 2 digit day and month

    if you want to use locale-independent formatting then use as below
    _LIT(KTime,"%F%/0%M%/1%Y%/2%D%/3");

    you can change the order, it is currently set as (mm/yyyy/dd)

  7. #7
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Re: Problem get 2 digit day and month

    Hi!
    U can use TShortDateFormatSpec

    Check Date and Time Handling in API Reference of SDK

    Hope this helps.
    Regards,
    Shilpa Kulkarni

  8. #8
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Brebes, Indonesia
    Posts
    129

    Re: Problem get 2 digit day and month

    Ok kiran10182.
    I just want get date and month for a day.
    _LIT( KDayFormat, "%D%1" );
    _LIT( KMonFormat, "%M%2" );
    The code has been solve my problem. Thanks
    http://blogehendrawan.blogspot.com - Kembangin symbian di Indonesia yukk....

Similar Threads

  1. JSR75 Problem with Dates/Times
    By YrK2 in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2007-03-20, 15:51
  2. How to get the maximum day in a month by given year and month ?
    By akokchai in forum Mobile Java General
    Replies: 1
    Last Post: 2005-04-08, 11:36
  3. Problem with my 6600 - help please!
    By dualcyclone in forum General Development Questions
    Replies: 5
    Last Post: 2004-10-15, 18:56

Posting Permissions

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