By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,051 Members | 1,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,051 IT Pros & Developers. It's quick & easy.

Différence entre deux heures

P: n/a
Bonjour,

Voila le morceau de code :

setlocale(LC_TIME, "fr" );
$Diff = strftime ("%H:%M:%S, (mktime(12,0,0,1,1,1970) -
mktime(6,0,0,1,1,1970)));

$Diff Retourne 07:00:00

et

$Diff = mktime(12,0,0,1,1,1970) - mktime(6,0,0,1,1,1970) ;

$Diff retourne 21600 ( 21600 / 6 => 6H)

Chercher L'erreur !!!!!
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Translated inline,

[translation]
Bonjour,
Hello

Voila le morceau de code :
Here is the peice of code

setlocale(LC_TIME, "fr" );
$Diff = strftime ("%H:%M:%S, (mktime(12,0,0,1,1,1970) -
mktime(6,0,0,1,1,1970)));

$Diff Retourne 07:00:00

et
and

$Diff = mktime(12,0,0,1,1,1970) - mktime(6,0,0,1,1,1970) ;

$Diff retourne 21600 ( 21600 / 6 => 6H)
$Diff returns 21600 ( 21600 / 6 => 6H)

Chercher L'erreur !!!!!


Find the error!!!!!
[translation]

Sims

Jul 17 '05 #2

P: n/a
I noticed that Message-ID: <c6************@ID-162430.news.uni-berlin.de>
from Sims contained the following:
[translation]


I understood the French. I don't understand what's causing the error.
:-}
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #3

P: n/a

Voila le morceau de code :

setlocale(LC_TIME, "fr" );
$Diff = strftime ("%H:%M:%S, (mktime(12,0,0,1,1,1970) -
mktime(6,0,0,1,1,1970)));

$Diff Retourne 07:00:00

et

$Diff = mktime(12,0,0,1,1,1970) - mktime(6,0,0,1,1,1970) ;

$Diff retourne 21600 ( 21600 / 6 => 6H)

Chercher L'erreur !!!!!


Le premier cas te montre l'heure local, 07:00 *du soir* le 1/1/1970

Le deuxieme cas te montre le nombre d'heure entre minuit et 6 heures de
moins, (donc 7:00pm).

Sims
Jul 17 '05 #4

P: n/a
[translation]


I understood the French. I don't understand what's causing the error.
:-}


It is not an error, one displays the time at (12am - 6hrs ) = 7pm and the
second case displays the difference between (12am-6hrs)= 6hrs

One shows the hour the other the time.

Sims
Jul 17 '05 #5

P: n/a
Thanks,

Merci a vous tous ...
"Sims" <si*********@hotmail.com> a écrit dans le message de
news:c6************@ID-162430.news.uni-berlin.de...

Voila le morceau de code :

setlocale(LC_TIME, "fr" );
$Diff = strftime ("%H:%M:%S, (mktime(12,0,0,1,1,1970) -
mktime(6,0,0,1,1,1970)));

$Diff Retourne 07:00:00

et

$Diff = mktime(12,0,0,1,1,1970) - mktime(6,0,0,1,1,1970) ;

$Diff retourne 21600 ( 21600 / 6 => 6H)

Chercher L'erreur !!!!!


Le premier cas te montre l'heure local, 07:00 *du soir* le 1/1/1970

Le deuxieme cas te montre le nombre d'heure entre minuit et 6 heures de
moins, (donc 7:00pm).

Sims

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.