Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor joteddy123's Avatar
    Join Date
    Feb 2009
    Posts
    53
    hii all...
    can anyone tell how to retrieve the day, month and year from what is entered in the Date Editor? we want to retrieve the day, month and year from the editor and store them separately in the database in 3 separate columns. How do we go about this?
    Thank u!

  2. #2
    Nokia Developer Moderator ltomuta's Avatar
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,335
    You retrieve the time value encoded in a TTime object using editor's Date() method. Then you convert that object into a TDateTime object by calling its DateTime() and use the new object to extract the data you need for your database.

    Obviously this is a Symbian C++ type of question, has nothing to do with Carbide.c++ or its UI Designer aside from understanding that the editor class it uses is CEikDateEditor.

  3. #3
    Nokia Developer Champion kiran10182's Avatar
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,236
    Quote Originally Posted by joteddy123 View Post
    hii all...
    can anyone tell how to retrieve the day, month and year from what is entered in the Date Editor? we want to retrieve the day, month and year from the editor and store them separately in the database in 3 separate columns. How do we go about this?
    Thank u!
    Check this: Querying Date and Time

    Also check this: Retrieve the number of the current week in the year

    Finally search for the TTime in the SDK help.
    Nokia Developer Wiki Moderation team

  4. #4
    Super Contributor tamhanna's Avatar
    Join Date
    Jul 2008
    Posts
    2,020
    Hi,
    here is part of the code I use in my own app. My settingslist is created by Carbide UI, and the call is to be found in the file with the shortest file name:

    Code:
    void CLocaNoteFilterSettings::SaveSettingValuesL()
    	{
    	// store values from iSettings
    	CLocaNoteAppUi* temp=static_cast<CLocaNoteAppUi*>(CEikonEnv::Static()->EikAppUi());
    	TDateTime val1, val2;
    	
    	temp->iPrefs->FilterNote=(LocaNotePrefFilterNote)iSettings.CmbCreateOrEdit();
    	
    	val1=iSettings.CmdFilterFromDate().DateTime();
    	val2=iSettings.CmdFilterFromTime().DateTime();
    	val1.SetHour(val2.Hour());
    	val1.SetMinute(val2.Minute());
    	val1.SetSecond(val2.Second());
    	temp->iPrefs->FilterFromDateTime=val1;
    	
    	val1=iSettings.CmbFilterToDate().DateTime();
    	val2=iSettings.CmbFilterToTime().DateTime();
    	val1.SetHour(val2.Hour());
    	val1.SetMinute(val2.Minute());
    	val1.SetSecond(val2.Second());
    	temp->iPrefs->FilterToDateTime=val1;	
    	}
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

Similar Threads

  1. Date & Time Editor in Form Resource.
    By Kavit Patel in forum Symbian C++
    Replies: 2
    Last Post: 2008-03-03, 06:26
  2. Integer Editor
    By prabhu23 in forum Symbian C++
    Replies: 12
    Last Post: 2007-10-18, 11:33
  3. Date editor pprblem
    By Gill in forum Symbian C++
    Replies: 3
    Last Post: 2007-03-07, 10:40
  4. Date Query Dialog
    By vasant21 in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-11-01, 11:50
  5. date of SMS doesn't match real date
    By iludwig in forum Symbian C++
    Replies: 0
    Last Post: 2006-09-18, 17:33

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