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 recieve time from system time

How recieve time from system time

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 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.
  • M Offline
    M Offline
    myshketer
    wrote on last edited by
    #1

    Hello! I have a digitals that contain a local time (1387475976). How I can recieve the correctly filled SYSTEMTIME struct? I try to use next code, but it is wrong: __int64 ull(1387475976); FILETIME lpFileTime; SYSTEMTIME SystemTime; memcpy(&lpFileTime, &ull, sizeof(__int64)); FileTimeToSystemTime(&lpFileTime, &SystemTime); cout << SystemTime.wYear << endl; In out SystemTime.wYear = 1601 :confused: Thanks, Andrey

    D R 2 Replies Last reply
    0
    • M myshketer

      Hello! I have a digitals that contain a local time (1387475976). How I can recieve the correctly filled SYSTEMTIME struct? I try to use next code, but it is wrong: __int64 ull(1387475976); FILETIME lpFileTime; SYSTEMTIME SystemTime; memcpy(&lpFileTime, &ull, sizeof(__int64)); FileTimeToSystemTime(&lpFileTime, &SystemTime); cout << SystemTime.wYear << endl; In out SystemTime.wYear = 1601 :confused: Thanks, Andrey

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      myshketer wrote:

      I have a digitals that contain a local time (1387475976).

      Does this represent the number of 100-nanosecond intervals since 1-January-1601?


      "A good athlete is the result of a good and worthy opponent." - David Crow

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      M 1 Reply Last reply
      0
      • D David Crow

        myshketer wrote:

        I have a digitals that contain a local time (1387475976).

        Does this represent the number of 100-nanosecond intervals since 1-January-1601?


        "A good athlete is the result of a good and worthy opponent." - David Crow

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        M Offline
        M Offline
        myshketer
        wrote on last edited by
        #3

        I thinked it is... but investigation show that it number too small

        D 1 Reply Last reply
        0
        • M myshketer

          Hello! I have a digitals that contain a local time (1387475976). How I can recieve the correctly filled SYSTEMTIME struct? I try to use next code, but it is wrong: __int64 ull(1387475976); FILETIME lpFileTime; SYSTEMTIME SystemTime; memcpy(&lpFileTime, &ull, sizeof(__int64)); FileTimeToSystemTime(&lpFileTime, &SystemTime); cout << SystemTime.wYear << endl; In out SystemTime.wYear = 1601 :confused: Thanks, Andrey

          R Offline
          R Offline
          Rage
          wrote on last edited by
          #4

          myshketer wrote:

          1387475976

          This is far too small. Where did you get that number ?

          Don't follow any man spiritually, don't do anything that will get you in sh*t if god is real - Bradml[^]

          1 Reply Last reply
          0
          • M myshketer

            I thinked it is... but investigation show that it number too small

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            That all depends on what you mean by "too small." Since there are 36,000,000,000 100-nanosecond intervals per hour, the value 1,387,475,976 is still within January 1st, 1601. Make sense?


            "A good athlete is the result of a good and worthy opponent." - David Crow

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            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