C/C++ Date manipulation code

This is a discussion on C/C++ Date manipulation code within the C Programming forums, part of the General Programming Boards category; Hello C/C++ gurus, I am kind of new and wanted to find out if anyone has some code samples where ...

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    2

    Question C/C++ Date manipulation code

    Hello C/C++ gurus,
    I am kind of new and wanted to find out if anyone has some code samples where they are manipulating dates - what I want to accomplish is do a lot of date comparisons, and then using logic to decide a distinct path of execution. So if anyone has any code where he/she has done extensive date manipulation/comparison, please let me know.
    Thanks in advance

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Probably the most portable call is the time() function which returns the number of seconds, (usually), that have passed since, (usually) 01/01/1970. This is, (usually), returned in some form of integer, so comparison can be easily done, as can arithmetic.

    Most OS's offer much more, but you don't state what you are using.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    2

    Date Manipulation in C code

    Hi,
    I am working on a UNIX (Solaris) env using C. Are there any date management functions that could help me to manipulate dates and include logic that would do different things depending on the date comparisons.
    thanks

  4. #4
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    All ANSI C data management functions in your book should be available on UNIX. If you don't have a book, there are references online.

    http://www.acm.uiuc.edu/webmonkeys/book/c_guide/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Explain this C code in english
    By soadlink in forum C Programming
    Replies: 16
    Last Post: 08-31-2006, 12:48 AM
  2. Replies: 1
    Last Post: 03-21-2006, 06:52 AM
  3. Problem : Threads WILL NOT DIE!!
    By hanhao in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2004, 01:37 PM
  4. Seems like correct code, but results are not right...
    By OmniMirror in forum C Programming
    Replies: 4
    Last Post: 02-13-2003, 12:33 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM

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