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. range

range

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

    I want to add items between two dates.I used CTime class to find the two dates(current and past). i want to add the list of url's i opened that range of time.Everything is fine but how can we make the condition on times for ex: for or while or if etc

    R 1 Reply Last reply
    0
    • R radhika28

      I want to add items between two dates.I used CTime class to find the two dates(current and past). i want to add the list of url's i opened that range of time.Everything is fine but how can we make the condition on times for ex: for or while or if etc

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

      CTime has normal add and compare operators, so you can loop on a CTime the same way you would do with an integer.

      ~RaGE();

      I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
      Do not feed the troll ! - Common proverb

      B 1 Reply Last reply
      0
      • R Rage

        CTime has normal add and compare operators, so you can loop on a CTime the same way you would do with an integer.

        ~RaGE();

        I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
        Do not feed the troll ! - Common proverb

        B Offline
        B Offline
        Bravoone_2006
        wrote on last edited by
        #3

        CTime CurTime = CTime::GetCurrentTime(); CString sTime1,sHour,sTime2; sTime1.Format("%d/%d/%d",CurTime.GetYear(),CurTime.GetMonth(),CurTime.GetDay()); sTime2.Format"%d/%d/%d", .......); m_time1.SetWindowText(sTime1); m_time2.SetWindowText(sTime2); if(sTime1 > sTime2) { //Do something //lets say m_time3.SetWindowText("Real time"); } UpdateData(FALSE); :)

        Bravoone

        R 1 Reply Last reply
        0
        • B Bravoone_2006

          CTime CurTime = CTime::GetCurrentTime(); CString sTime1,sHour,sTime2; sTime1.Format("%d/%d/%d",CurTime.GetYear(),CurTime.GetMonth(),CurTime.GetDay()); sTime2.Format"%d/%d/%d", .......); m_time1.SetWindowText(sTime1); m_time2.SetWindowText(sTime2); if(sTime1 > sTime2) { //Do something //lets say m_time3.SetWindowText("Real time"); } UpdateData(FALSE); :)

          Bravoone

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

          I have converted file time to system time using the function, FileTimeToSystemTime(&suURL.ftLastVisited,&st); Now can i get the time in CTime from the above line.I am able to display the string value for that particular systemtime.otherwise how can we convert CString to CTime. Thanks

          D 1 Reply Last reply
          0
          • R radhika28

            I have converted file time to system time using the function, FileTimeToSystemTime(&suURL.ftLastVisited,&st); Now can i get the time in CTime from the above line.I am able to display the string value for that particular systemtime.otherwise how can we convert CString to CTime. Thanks

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

            radhika28 wrote:

            otherwise how can we convert CString to CTime.

            If the time is in a standard format, use COleDateTime::ParseDateTime(). The CTime class is too limiting.


            "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

            "Judge not by the eye but by the heart." - Native American Proverb

            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