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. help about date time

help about date time

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

    i am new to mfc. i my application i am usind CTime object. i need to store time beyond 1st jan 2038 in that object. I guess CTime object wont be able to store values beyond 1st jan 2038 , so what other options i have ,,, say i want to store year value as 2150. pls help Vikram

    T N V 3 Replies Last reply
    0
    • V Vikram

      i am new to mfc. i my application i am usind CTime object. i need to store time beyond 1st jan 2038 in that object. I guess CTime object wont be able to store values beyond 1st jan 2038 , so what other options i have ,,, say i want to store year value as 2150. pls help Vikram

      T Offline
      T Offline
      Tony Hill
      wrote on last edited by
      #2

      Try using COleDateTime instead.

      V 1 Reply Last reply
      0
      • V Vikram

        i am new to mfc. i my application i am usind CTime object. i need to store time beyond 1st jan 2038 in that object. I guess CTime object wont be able to store values beyond 1st jan 2038 , so what other options i have ,,, say i want to store year value as 2150. pls help Vikram

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

        vikram Verma wrote:

        i need to store time beyond 1st jan 2038 in that object

        As the other guy said use COleDateTime, but do not use COleDateTime::GetCurrentTime... From MSDN... COleDateTime::GetCurrentTime. The current implementation calls the C run-time function time, which returns a time_t. This limitation isn't currently documented—it presumably took Chris's digging through the Microsoft Foundation Classes (MFC) source code to find it. (As Dr. GUI says, "Use the source, Luke!") Good job. Don't use this function if you need to be year 2038 compliant. Note also that COleDateTime has a constructor and assignment operator that take a time_t—don't use those either. A suitable replacement will be GetLocalTime.


        Nibu thomas A Developer Programming tips[^]  My site[^]

        1 Reply Last reply
        0
        • V Vikram

          i am new to mfc. i my application i am usind CTime object. i need to store time beyond 1st jan 2038 in that object. I guess CTime object wont be able to store values beyond 1st jan 2038 , so what other options i have ,,, say i want to store year value as 2150. pls help Vikram

          V Offline
          V Offline
          Vikram
          wrote on last edited by
          #4

          Thanks .... :) .. for my app COleDatetime Seems to be working fine... But would like to find a better option.

          1 Reply Last reply
          0
          • T Tony Hill

            Try using COleDateTime instead.

            V Offline
            V Offline
            Vikram
            wrote on last edited by
            #5

            thanks ... COleDatetime seems to be working fine..

            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