CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Time function

  1. #1
    Join Date
    Jun 2008
    Posts
    1

    Unhappy Time function

    Dear All,

    SetLocalTime API is working fine in Win Mobile 5.0.But SetSystemTime is giving a time diff of eight hours ahead.I am working on Win Mobile 5.0 SDK platform.

    Please help....

  2. #2
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Time function

    You need to offset the time for the TimeZone...

    Quote Originally Posted by MSDN Online
    SetSystemTime
    This function sets the current system time and date. The system time is expressed in UTC.
    Quote Originally Posted by MSDN Online
    SetTimeZoneInformation
    This function sets the current time-zone parameters. These parameters control translations from UTC to local time.


    Remarks
    SetTimeZoneInformation does not change the clock and therefore will not affect subsequent calls to GetLocalTime. SetTimeZoneInformation only affects subsequent calls to GetSystemTime.

    SetTimeZoneInformation does not save the newly written data into the persistent registry. To write the data permanently, you need to make the following call: RegFlushKey(HKEY_LOCAL_MACHINE). For more information, see RegFlushKey.

    All translations between UTC and local time are based on the following formula.

    UTC = local time + bias
    The bias is the difference, in minutes, between UTC and local time.
    Hope this Helps....

    Gremmy
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured