Thread: C++ date time

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    58

    C++ date time

    Hi,i am a c++ beginer(*not C++.net*).i am using the visual studio 2003 comand prompt compiler.



    I wan't to write program that prints the current date and time.

    Can some one tell me the code/statement that would do print the date and time??

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Check this page out: http://www.cplusplus.com/reference/clibrary/ctime/

    That should give you the list of functions necessary to do all kinds of things with date and time. Just remember to include the <ctime> header before you use any of those functions or data types.

  3. #3
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    1. read FAQ http://faq.cprogramming.com/cgi-bin/...&id=1043284392
    2. search forum with "date time" key words
    3. read the answers to the similar questions
    4. write your own code
    5. if you'll have problems - post your code and ask concrete question
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Military Time Functions
    By BB18 in forum C Programming
    Replies: 6
    Last Post: 10-10-2004, 01:57 PM
  2. Getting time and date
    By winsonlee in forum C++ Programming
    Replies: 3
    Last Post: 08-18-2004, 11:31 PM
  3. The space time continueimnms mm... (rant)
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 32
    Last Post: 06-27-2004, 01:21 PM
  4. Help: Display time and date
    By stansu in forum C++ Programming
    Replies: 5
    Last Post: 08-22-2003, 02:27 PM
  5. I apologize. Good bye.
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 05-03-2002, 06:51 PM