×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    139

    TTime::Parse() with correct DateFormat

    hey,
    I would like to parse TDesC to TTime format usind TTime::Parse().

    As I noticed this functions use system DateFormat to parse TDesC correctly.
    I know that I can change system DateFormat using TLocale::Set() if TLocale:ateFormat() doesnt match my preferred DateFormat, but it is risky (what if my application Panic??).

    My question is how to change DateFormat temporarly (just for my application) to let TTime::Parse() parse my TDesC without interferring to system settings.
    Peter

  2. #2
    Super Contributor
    Join Date
    May 2006
    Location
    Beijing,China
    Posts
    1,190

    Re: TTime::Parse() with correct DateFormat

    How about the FormatL() function in TTime?
    [I][COLOR="Orange"]xhsoldier[/COLOR][/I]
    [email]xhsoldier@gmail.com[/email]/[email]xhsoldier@163.com[/email]

  3. #3
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    139

    Re: TTime::Parse() with correct DateFormat

    Quote Originally Posted by xhsoldier View Post
    How about the FormatL() function in TTime?
    But I want to convert FROM TDesC -> TO TTime.

    As I use FormatL only FROM TTime -> TO TDesC

    Peter

  4. #4
    Registered User
    Join Date
    Jan 2007
    Posts
    282

    Re: TTime::Parse() with correct DateFormat

    Prefer using TTime::Parse.

    If that doesnt help then you can parse the date time components manually and assign these values to a TDateTime object. Once you are done with parsing you can create a TTime object by passing TDateTime object to its constructor TTime::TTime(const TDateTime &aDateTime)

    Hope that helps,
    VJ

  5. #5
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    139

    Re: TTime::Parse() with correct DateFormat

    Quote Originally Posted by vaibhavjain View Post
    Prefer using TTime::Parse.

    If that doesnt help then you can parse the date time components manually and assign these values to a TDateTime object. Once you are done with parsing you can create a TTime object by passing TDateTime object to its constructor TTime::TTime(const TDateTime &aDateTime)

    Hope that helps,
    VJ
    Thanks for your answer.

    I know I can do it manually for example check DateFormat on device and compare to dateformat of my TDesC and rebuil it to device format and it is OK.

    But I ve to read a lots of Date&Time TDesC and do it repeatadly.

    I m looking for as fast as possible solution

  6. #6
    Registered User
    Join Date
    Jan 2007
    Posts
    282

    Re: TTime::Parse() with correct DateFormat

    Can you please tell us the date/time you are trying to parse. I think i will be able to help you better if thats known.

    VJ

  7. #7
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    139

    Re: TTime::Parse() with correct DateFormat

    Quote Originally Posted by vaibhavjain View Post
    Can you please tell us the date/time you are trying to parse. I think i will be able to help you better if thats known.

    VJ
    hey

    I am reading from file day/month/year hour:min:sec (euro)

    I wanna convert it to TTime without dependency on local DateFormat. As fast as possible.
    I know how to check local DateFormat and rebuild file string to correct format but I want to avod this.
    Peter

Similar Threads

  1. Replies: 2
    Last Post: 2009-03-13, 02:00
  2. The correct meaning of MAX JAR size
    By bigrio in forum Mobile Java General
    Replies: 1
    Last Post: 2004-11-16, 10:30
  3. Correct MTM hook
    By dancom in forum Symbian
    Replies: 1
    Last Post: 2003-06-28, 12:44
  4. correct way to release all resources
    By gpg15600 in forum Mobile Java General
    Replies: 10
    Last Post: 2003-04-23, 09:10
  5. 1SMIL more 1Txt ,more 1 Image NOT SORT CORRECT in EPOC
    By golf123 in forum General Messaging
    Replies: 1
    Last Post: 2002-09-18, 12:09

Posting Permissions

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