PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > time problems
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
time problems

Réponse
 
LinkBack Outils de la discussion
Vieux 01/06/2008, 08h41   #1
MaXy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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(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


  Réponse avec citation
Vieux 01/06/2008, 08h45   #2
Harald van Dijk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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(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.
  Réponse avec citation
Vieux 01/06/2008, 11h49   #3
MaXy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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


  Réponse avec citation
Vieux 01/06/2008, 21h28   #4
santosh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: time problems

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

  Réponse avec citation
Vieux 02/06/2008, 16h46   #5
MaXy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 10h57.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,58734 seconds with 13 queries