C++ date time

This is a discussion on C++ date time within the C++ Programming forums, part of the General Programming Boards category; 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 ...

  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,211
    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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,471
    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
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

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

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