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. A difficult question for me to resolve about C++ and Access datetime type

A difficult question for me to resolve about C++ and Access datetime type

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++phpcom
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.
  • F Offline
    F Offline
    fyr000000
    wrote on last edited by
    #1

    http://www.codeguru.com/forum/showthread.php?t=387391[^] The question is above the link:) Jeff Fan No change is the worst!!! The principal of mine msn:fyr000000@hotmail.com If you like coding , add me.

    C H F T D 5 Replies Last reply
    0
    • F fyr000000

      http://www.codeguru.com/forum/showthread.php?t=387391[^] The question is above the link:) Jeff Fan No change is the worst!!! The principal of mine msn:fyr000000@hotmail.com If you like coding , add me.

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      Your question is not very clear, but if you want to get the current time, you can use:

      CTime Time = CTime::GetCurrentTime();


      Cédric Moonen Software developer
      Charting control

      1 Reply Last reply
      0
      • F fyr000000

        http://www.codeguru.com/forum/showthread.php?t=387391[^] The question is above the link:) Jeff Fan No change is the worst!!! The principal of mine msn:fyr000000@hotmail.com If you like coding , add me.

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        if you need to current time see CString str; SYSTEMTIME st; GetLocalTime(&st); str.Format("%d:%d:%d:",st.wHour,st.wMinute,st.wSecond);_**


        **_

        whitesky


        1 Reply Last reply
        0
        • F fyr000000

          http://www.codeguru.com/forum/showthread.php?t=387391[^] The question is above the link:) Jeff Fan No change is the worst!!! The principal of mine msn:fyr000000@hotmail.com If you like coding , add me.

          F Offline
          F Offline
          fyr000000
          wrote on last edited by
          #4

          How can I insert the System time(current time) into access like the former in C++ (eg. 2006-04-19 16:41) ??? The time in access is datetime type!!! I know in Java , it can use the method getdate(). But I have scanned many meterials , that I can't find in C++ retcode=SQLExecDirect(hstmt,(UCHAR*)"insert into package(Protocol,SrcAddr,DstAddr,SrcPort,DstPort,TotalLen,GetTime)values('a','b','c','d','e',2000000,'3-2-2006')",SQL_NTS);//SQLÓï¾äÖ´Ðгö´í the quote '3-2-2006' of the sentence , can i substitue with the system time??? Jeff Fan No change is the worst!!! The principal of mine msn:fyr000000@hotmail.com If you like coding , add me.

          F 1 Reply Last reply
          0
          • F fyr000000

            http://www.codeguru.com/forum/showthread.php?t=387391[^] The question is above the link:) Jeff Fan No change is the worst!!! The principal of mine msn:fyr000000@hotmail.com If you like coding , add me.

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            fyr000000 wrote:

            http://www.codeguru.com/forum/showthread.php?t=387391\[^\]

            Isn't CodeGuru help you?, any way you can try COLEDateTime.

            COleDateTime curTime= COleDateTime::GetCurrentTime( );
            CString str = curTime.Format(_T(" %Y-%m-%d %I:%M"));

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta VC Forum Q&A :- I/ IV

            1 Reply Last reply
            0
            • F fyr000000

              http://www.codeguru.com/forum/showthread.php?t=387391[^] The question is above the link:) Jeff Fan No change is the worst!!! The principal of mine msn:fyr000000@hotmail.com If you like coding , add me.

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

              Ovidiu answered your question very plainly. What's the problem?


              "The largest fire starts but with the smallest spark." - David Crow

              1 Reply Last reply
              0
              • F fyr000000

                How can I insert the System time(current time) into access like the former in C++ (eg. 2006-04-19 16:41) ??? The time in access is datetime type!!! I know in Java , it can use the method getdate(). But I have scanned many meterials , that I can't find in C++ retcode=SQLExecDirect(hstmt,(UCHAR*)"insert into package(Protocol,SrcAddr,DstAddr,SrcPort,DstPort,TotalLen,GetTime)values('a','b','c','d','e',2000000,'3-2-2006')",SQL_NTS);//SQLÓï¾äÖ´Ðгö´í the quote '3-2-2006' of the sentence , can i substitue with the system time??? Jeff Fan No change is the worst!!! The principal of mine msn:fyr000000@hotmail.com If you like coding , add me.

                F Offline
                F Offline
                fyr000000
                wrote on last edited by
                #7

                I am sorry that I have asked by mistake ! I go to the link again!!! Thank you all very much. Jeff Fan No change is the worst!!! The principal of mine msn:fyr000000@hotmail.com If you like coding , add me.

                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