×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    95

    How to get System time and system date

    hi,

    I M MAKING AN APPLICATION IN WHICH I WANT

    1.TO SHOW AN CLOCK ...... HOW CAN I ACCESS THE SYSTEM TIME AND GET UPDATED EVERY TIME IT GETS CHANGED?

    2.Current SyStem Date ...... AND GET UPDATED EVERY TIME IT GETS CHANGED?

    3. Current day..........AND GET UPDATED EVERY TIME IT GETS CHANGED?


    Thanks in advance.

  2. #2
    Regular Contributor
    Join Date
    May 2003
    Location
    India
    Posts
    136

    Re: How to get System time and system date


  3. #3
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    95

    Re: How to get System time and system date

    hi,

    This is symbian section.the code u have given is for python...I need it in symbian c++..

  4. #4
    Regular Contributor
    Join Date
    May 2003
    Location
    India
    Posts
    136

    Re: How to get System time and system date

    sorry for that...

    TTime homeTime;
    TBuf<32> buf;
    homeTime.HomeTime();
    _LIT(KFormatTxt,"%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B");
    homeTime.FormatL(buf,KFormatTxt);
    // Output 19/05/1997 9:44:51 am

  5. #5
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: How to get System time and system date

    check TTime in SDK. Also see UniversalTime (for 3rd edition) and HomeTime (for 2nd edition) of TTime.

  6. #6
    Registered User
    Join Date
    Dec 2005
    Location
    Finland
    Posts
    109

    Re: How to get System time and system date

    You might want to check RDigitalClock:
    Code:
    RWsSession rwss;
    rwss = CEikonEnv::Static()->WsSession();
    RAnimDll clockAnimDll(rwss);
    
    clockAnimDll.Load(_L("CLOCKA.DLL"));
    iBigClock = new RDigitalClock(clockAnimDll, (RWindowBase)Window());
    
    TMargins margin;
    margin.iLeft=0;
    margin.iTop = 0;
    margin.iRight=0;
    margin.iBottom=0;
    
    STimeDeviceShadow tds;
    tds.iColor = KRgbGray;
    tds.iIsOn = EFalse;
    tds.iOffset = TPoint(1,1);
    
    iBigClock->ConstructL(User::UTCOffset(),TPoint(8,0),TSize(aRect.Width(),30),margin,tds,	TRgb::KRgbWhite,1);
    
    TFontSpec MyFontSpec(_L("Arial"), 160);
    CFbsFont *font = iCoeEnv->CreateScreenFontL(MyFontSpec);
    
    _LIT(timebuffer,"%D%M%Y%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B");
    TBuf<252> timeFormat;
    timeFormat.Copy(timebuffer);
    TInt handle = font->Handle();
    TDigitalDisplayTextSection* textSection = new (ELeave) TDigitalDisplayTextSection(handle,TRgb::KRgbDarkRed, EDigitalDisplayHorizontalTextAlignmentLeft, EDigitalDisplayVerticalTextAlignmentTop, 0, 0,timeFormat);
    
    iBigClock->AddTextSectionL(*textSection);
    iBigClock->SetVisible(ETrue);

Similar Threads

  1. System time changed.
    By StasV in forum Symbian
    Replies: 9
    Last Post: 2009-04-13, 09:22
  2. how to access system time and date
    By gnanasenthil654321 in forum Symbian
    Replies: 3
    Last Post: 2008-11-17, 16:41
  3. Replies: 0
    Last Post: 2008-01-03, 17:58
  4. 6670 asks for date time on startup
    By collinar in forum General Development Questions
    Replies: 0
    Last Post: 2005-09-28, 16:03
  5. How to set system date and time
    By gswarup in forum Mobile Java General
    Replies: 0
    Last Post: 2005-01-21, 12:40

Posting Permissions

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