Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to get "Date-Time-Zone"

How to get "Date-Time-Zone"

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Russell
    wrote on last edited by
    #1

    Need to format the date-time in the current format:

    Thu, 15 Apr 2010 03:23:58 -0700

    where you can see the date, the time and finally the zone indication. I've no problem with the first 2 fields: I'm correcly using a combination of the functions: GetSystemTime GetDateFormat GetTimeFormat Now. How can I get (from the system) and then add (to the string) the zone?


    Russell

    R M 2 Replies Last reply
    0
    • R Russell

      Need to format the date-time in the current format:

      Thu, 15 Apr 2010 03:23:58 -0700

      where you can see the date, the time and finally the zone indication. I've no problem with the first 2 fields: I'm correcly using a combination of the functions: GetSystemTime GetDateFormat GetTimeFormat Now. How can I get (from the system) and then add (to the string) the zone?


      Russell

      R Offline
      R Offline
      Russell
      wrote on last edited by
      #2

      Found the solution: neede to use the function GetTimeZoneInformation and "restyle" the bias in the same format.


      Russell

      1 Reply Last reply
      0
      • R Russell

        Need to format the date-time in the current format:

        Thu, 15 Apr 2010 03:23:58 -0700

        where you can see the date, the time and finally the zone indication. I've no problem with the first 2 fields: I'm correcly using a combination of the functions: GetSystemTime GetDateFormat GetTimeFormat Now. How can I get (from the system) and then add (to the string) the zone?


        Russell

        M Offline
        M Offline
        Michel Godfroid
        wrote on last edited by
        #3

        Use GetTimeZoneInformation, Check the return code (this will tell you which bias to use), display StandardBias or DayLightBias

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups