Thread: C/C++ Date manipulation code

  1. #1
    Registered User
    Join Date
    Apr 2002

    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
    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

    Date Manipulation in C code

    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.

  4. #4
    Join Date
    Aug 2001
    Groningen (NL)
    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.

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, 07: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, 01:33 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM