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. formating date and time

formating date and time

Scheduled Pinned Locked Moved C / C++ / MFC
databasequestion
5 Posts 4 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    Hi i have the following bit of code which i use to pull the 'date_in' field from my database, using ado variant v_Time_Issued vTime_Issued = cpSet->GetCollect(L"date_in"); date_in has the value 2003-04-22 10:19:18.000 i need to be able to format the vTime_Issued so that im just left with the time so all i want from date_in is 10:19 any ideas ????? Si

    F J D 4 Replies Last reply
    0
    • A Anonymous

      Hi i have the following bit of code which i use to pull the 'date_in' field from my database, using ado variant v_Time_Issued vTime_Issued = cpSet->GetCollect(L"date_in"); date_in has the value 2003-04-22 10:19:18.000 i need to be able to format the vTime_Issued so that im just left with the time so all i want from date_in is 10:19 any ideas ????? Si

      F Offline
      F Offline
      fabjoe
      wrote on last edited by
      #2

      You can create a COleDateTime with the vTime_Issued and then you can use the member function GetMinute() and GetHour() to extract the required info. Bye

      1 Reply Last reply
      0
      • A Anonymous

        Hi i have the following bit of code which i use to pull the 'date_in' field from my database, using ado variant v_Time_Issued vTime_Issued = cpSet->GetCollect(L"date_in"); date_in has the value 2003-04-22 10:19:18.000 i need to be able to format the vTime_Issued so that im just left with the time so all i want from date_in is 10:19 any ideas ????? Si

        F Offline
        F Offline
        fabjoe
        wrote on last edited by
        #3

        You can create a COleDateTime with the vTime_Issued and then you can use the member function GetDay() and GetHour() to extract the required info. Bye

        1 Reply Last reply
        0
        • A Anonymous

          Hi i have the following bit of code which i use to pull the 'date_in' field from my database, using ado variant v_Time_Issued vTime_Issued = cpSet->GetCollect(L"date_in"); date_in has the value 2003-04-22 10:19:18.000 i need to be able to format the vTime_Issued so that im just left with the time so all i want from date_in is 10:19 any ideas ????? Si

          J Offline
          J Offline
          Jason Henderson
          wrote on last edited by
          #4

          Use COleDateTime in your app or modify the SQL getting the date_in from the database to only show the time.

          Jason Henderson

          My articles

          "The best argument against democracy is a five-minute conversation with the average voter." - Winston Churchill

          1 Reply Last reply
          0
          • A Anonymous

            Hi i have the following bit of code which i use to pull the 'date_in' field from my database, using ado variant v_Time_Issued vTime_Issued = cpSet->GetCollect(L"date_in"); date_in has the value 2003-04-22 10:19:18.000 i need to be able to format the vTime_Issued so that im just left with the time so all i want from date_in is 10:19 any ideas ????? Si

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

            If you are using MFC, read on. COleDateTime datetime; // **ParseDateTime()** is passed a null-terminated string (which you would extract from **v_Time_Issued**) datetime.ParseDateTime("2003-04-22 10:19:18.000"); TRACE("%s\n", datetime.Format("%H:%M"));

            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