Date

This is a discussion on Date within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by whiteflags Why not? tm is a representation of the date in human readable form. You would know ...

  1. #16
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,612
    Quote Originally Posted by whiteflags View Post
    Why not? tm is a representation of the date in human readable form. You would know that if...
    I know that, except it counts dates from 1970, so 2009 becomes 39, and it counts months from 0, so August would not be 8, but 7.
    Confusing, but true. Semi-human readable format if you ask me.

    Since Y2K a different field has been introduced for the full year: You were probably using the legacy field.
    Then I blame poor documentation. I don't remember, but I don't think there was/is any such thing.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    and it counts months from 0, so August would not be 8, but 7.
    As a programmer, I think it's natural for the months to be zero indexed (just like arrays are).

  3. #18
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,705
    Then I blame poor documentation. I don't remember, but I don't think there was/is any such thing.
    The documentation is not at fault, it's all in my head, unfortunately. I made a mistake. I'm putting the subject at rest though. We'll have to discuss it elsewhere.

  4. #19
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,612
    Quote Originally Posted by bithub View Post
    As a programmer, I think it's natural for the months to be zero indexed (just like arrays are).
    It feels more natural to me that if I say it's month 8, then it's month 8.
    This is human readable format, after all, not programming format.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #20
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,304
    This reminds me of:
    xkcd - A Webcomic - 2038
    (read the tool tip too!)
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Advancing day by day until it matches a second date
    By nhubred in forum C++ Programming
    Replies: 1
    Last Post: 05-30-2009, 08:55 AM
  2. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  3. Date program starts DOS's date
    By jrahhali in forum C++ Programming
    Replies: 1
    Last Post: 11-24-2003, 04:23 PM
  4. CDate Class - handle date manipulation simply
    By LuckY in forum C++ Programming
    Replies: 5
    Last Post: 07-16-2003, 08:35 AM

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