time problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MaXy

    time problems

    I use freebsd 6.3-release on sun ultra5, gcc 3.4.6.
    this code:

    time_t timCorr;
    struct tm *tmCorr;

    timCorr=time(NU LL);
    tmCorr=localtim e(&timCorr);


    when i get tmCorr->tm_year, it gives me 108, instead of 2008.
    tmCorr->tm_mon gives me 4 instead of 5.

    it's correct or it's a bug?
    the distribution of freebsd for ultrasparc it is not so good...

    --
    Spolvera la mia email per rispondermi

    "Storia del Mondo. I vulcani eruttarono. Gli oceani ribollirono.
    L'universo era in tumulto. Poi venne il cane."
    Snoopy

    maxy04.splinder .com

    questo articolo e` stato inviato via web dal servizio gratuito
    http://www.newsland.it/news segnala gli abusi ad abuse@newsland. it


  • Harald van =?UTF-8?b?RMSzaw==?=

    #2
    Re: time problems

    On Sun, 01 Jun 2008 09:41:32 +0200, MaXy wrote:
    I use freebsd 6.3-release on sun ultra5, gcc 3.4.6. this code:
    >
    time_t timCorr;
    struct tm *tmCorr;
    >
    timCorr=time(NU LL);
    tmCorr=localtim e(&timCorr);
    >
    when i get tmCorr->tm_year, it gives me 108, instead of 2008.
    tmCorr->tm_mon gives me 4 instead of 5.
    >
    it's correct or it's a bug?
    That's correct. In cases like these, you can refer to the documentation
    (you can probably run `man localtime`), which should tell you that months
    are counted from 0 to 11, and years are counted since 1900.

    Comment

    • MaXy

      #3
      Re: time problems

      That's correct. In cases like these, you can refer to the documentation
      (you can probably run `man localtime`)
      you are right, but on the machine i can't use "man".
      i have access to the machine only for g++ and newsreader...


      --
      Spolvera la mia email per rispondermi

      "Storia del Mondo. I vulcani eruttarono. Gli oceani ribollirono.
      L'universo era in tumulto. Poi venne il cane."
      Snoopy

      maxy04.splinder .com

      questo articolo e` stato inviato via web dal servizio gratuito
      http://www.newsland.it/news segnala gli abusi ad abuse@newsland. it


      Comment

      • santosh

        #4
        Re: time problems

        MaXy wrote:
        >That's correct. In cases like these, you can refer to the
        >documentatio n (you can probably run `man localtime`)
        >
        you are right, but on the machine i can't use "man".
        i have access to the machine only for g++ and newsreader...
        Apart from the standard itself the following link is a good source of
        documentation for the standard C library.

        <http://www.dinkumware. com/manuals/>

        Comment

        • MaXy

          #5
          Re: time problems

          Apart from the standard itself the following link is a good source of
          documentation for the standard C library.
          <http://www.dinkumware. com/manuals/>
          very good, thanks!

          --
          Spolvera la mia email per rispondermi

          "Storia del Mondo. I vulcani eruttarono. Gli oceani ribollirono.
          L'universo era in tumulto. Poi venne il cane."
          Snoopy

          maxy04.splinder .com

          questo articolo e` stato inviato via web dal servizio gratuito
          http://www.newsland.it/news segnala gli abusi ad abuse@newsland. it


          Comment

          Working...