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. time and date matters: VC 7(VC++.NET)

time and date matters: VC 7(VC++.NET)

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpc++help
7 Posts 5 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.
  • L Offline
    L Offline
    luhfluh
    wrote on last edited by
    #1

    Hi all, I must say how useful I find the help offered here. Although sometimes it takes a while to get a response, the wait nullified by some mouthwatering suggestions. Anyway let me get down to my question. I want to display the time and date (from my system clock or local clock) in a text box inside a Dialog box. Any suggestions? Regards, luhfluh

    M C N L 4 Replies Last reply
    0
    • L luhfluh

      Hi all, I must say how useful I find the help offered here. Although sometimes it takes a while to get a response, the wait nullified by some mouthwatering suggestions. Anyway let me get down to my question. I want to display the time and date (from my system clock or local clock) in a text box inside a Dialog box. Any suggestions? Regards, luhfluh

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Check out GetLocalTime() and GetTimeFormat()

      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

      1 Reply Last reply
      0
      • L luhfluh

        Hi all, I must say how useful I find the help offered here. Although sometimes it takes a while to get a response, the wait nullified by some mouthwatering suggestions. Anyway let me get down to my question. I want to display the time and date (from my system clock or local clock) in a text box inside a Dialog box. Any suggestions? Regards, luhfluh

        C Offline
        C Offline
        Chris Losinger
        wrote on last edited by
        #3

        there are a bunch of static-based clock controls over here : http://www.codeproject.com/staticctrl/[^] Cleek | Image Toolkits | Thumbnail maker

        1 Reply Last reply
        0
        • L luhfluh

          Hi all, I must say how useful I find the help offered here. Although sometimes it takes a while to get a response, the wait nullified by some mouthwatering suggestions. Anyway let me get down to my question. I want to display the time and date (from my system clock or local clock) in a text box inside a Dialog box. Any suggestions? Regards, luhfluh

          N Offline
          N Offline
          Nibu babu thomas
          wrote on last edited by
          #4

          COleDateTime t = COleDateTime::GetCurrentTime();
          CString str = t.Format(_T("%A, %B %d, %Y"));
          m_edit.SetWindowText(str);

          For more information on format flags used in Format look here[^]


          Nibu thomas Software Developer

          S L 2 Replies Last reply
          0
          • N Nibu babu thomas

            COleDateTime t = COleDateTime::GetCurrentTime();
            CString str = t.Format(_T("%A, %B %d, %Y"));
            m_edit.SetWindowText(str);

            For more information on format flags used in Format look here[^]


            Nibu thomas Software Developer

            S Offline
            S Offline
            Stephen Hewitt
            wrote on last edited by
            #5

            Using Michael Dunn's method you can ensure that the date is formatted as per the setting in the users locale. Steve

            1 Reply Last reply
            0
            • L luhfluh

              Hi all, I must say how useful I find the help offered here. Although sometimes it takes a while to get a response, the wait nullified by some mouthwatering suggestions. Anyway let me get down to my question. I want to display the time and date (from my system clock or local clock) in a text box inside a Dialog box. Any suggestions? Regards, luhfluh

              L Offline
              L Offline
              luhfluh
              wrote on last edited by
              #6

              Thanks y'all, I tried the various ways and i'm glad with the results. Regards...

              1 Reply Last reply
              0
              • N Nibu babu thomas

                COleDateTime t = COleDateTime::GetCurrentTime();
                CString str = t.Format(_T("%A, %B %d, %Y"));
                m_edit.SetWindowText(str);

                For more information on format flags used in Format look here[^]


                Nibu thomas Software Developer

                L Offline
                L Offline
                luhfluh
                wrote on last edited by
                #7

                Hi, when i first tried the above code on a new empty project, it worked without any problems.(after including the ATLComTime.h) But i finally modify and use it in my intended solution and i have 4 errors and 4 warnings: C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935: assembly access specifier modified from 'public' C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935: assembly access specifier modified from 'public' C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872: 'IDataObject' : ambiguous symbol could be 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : System::Windows::Forms::IDataObject IDataObject' or 'stdafx.cpp(0) : System::Windows::Forms::IDataObject' C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7422) : fatal error C1903: unable to recover from previous error(s); stopping compilation Form1.cpp C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : warning C4935: assembly access specifier modified from 'public' C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(258) : warning C4935: assembly access specifier modified from 'public' C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7408) : error C2872: 'IDataObject' : ambiguous symbol could be 'C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(246) : System::Windows::Forms::IDataObject IDataObject' or 'stdafx.cpp(0) : System::Windows::Forms::IDataObject' C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ObjIdl.h(7422) : fatal error C1903: unable to recover from previous error(s); stopping compilation Generating Code... Can you figure out what I might nid to do? Tks

                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