|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I use freebsd 6.3-release on sun ultra5, gcc 3.4.6.
this code: time_t timCorr; struct tm *tmCorr; timCorr=time(NULL); tmCorr=localtime(&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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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(NULL); > tmCorr=localtime(&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. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
> 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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
MaXy wrote:
>> 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... Apart from the standard itself the following link is a good source of documentation for the standard C library. <http://www.dinkumware.com/manuals/> |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
> 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 |
|
![]() |
| Outils de la discussion | |
|
|