Getting Current Date (not time_t)

This is a discussion on Getting Current Date (not time_t) within the C++ Programming forums, part of the General Programming Boards category; Hi there, In C++, how do I get the current date WITHOUT using the C style time_t time() function? I'm ...

  1. #1
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812

    Getting Current Date (not time_t)

    Hi there,

    In C++, how do I get the current date WITHOUT using the C style time_t time() function?

    I'm looking for something which can cope with a more expansive range of dates, as opposed to the 1970 to 2038 year range imposed by current implementations of time_t.

    Thanks
    OS: Windows XP
    Compilers: MinGW (Code::Blocks), BCB 5

    BigAngryDog.com

  2. #2
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    I don't *think* that C++ defines the range for the time_t type. It is compiler-defined.

    You will have to use function specific for your operating system. In Windows, you can use the GetSystemTime() function.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #3
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    Hi Sang-drax,

    Nice to hear from you again.

    >You will have to use function specific for your operating system

    Thought so.

    Thanks for the reply.
    OS: Windows XP
    Compilers: MinGW (Code::Blocks), BCB 5

    BigAngryDog.com

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Immediate programming help! Please!
    By xMEGANx in forum C++ Programming
    Replies: 6
    Last Post: 02-20-2008, 11:52 AM
  2. Problem with simple case statements
    By shoobsie in forum C Programming
    Replies: 2
    Last Post: 05-08-2006, 08:39 AM
  3. compiler build error
    By KristTlove in forum C++ Programming
    Replies: 2
    Last Post: 11-30-2003, 09:16 AM
  4. linked list recursive function spaghetti
    By ... in forum C++ Programming
    Replies: 4
    Last Post: 09-02-2003, 02:53 PM
  5. How do I get the current date in my code?
    By FromHolland in forum C++ Programming
    Replies: 3
    Last Post: 04-08-2003, 01:37 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21