#19847 [Fbk]: day of weeks on october month

From: Date: Thu, 10 Oct 2002 20:32:33 +0000
Subject: #19847 [Fbk]: day of weeks on october month
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22100@lists.php.net to get a copy of this message
 ID:               19847
 Updated by:       msopacua@php.net
 Reported By:      davis@suldigital.com.br
 Status:           Feedback
 Bug Type:         Date/time related
 Operating System: BSD
 PHP Version:      4.2.3
 New Comment:

Can't verify on FreeBSD 4.6-RELEASE, BSD/OS 4.1, BSD/OS 4.2.

davis@sudligital.com.br:
In addition to the BSD version, what is the locale string for your
platform (env | grep LC_)?

I also modified it, to force DLS on the correct date, but doesn't have
any impact:
$ sapi/cli/php -f ./date.php 
mes/ano: Oct/2002

1 Tue : Terça-Feira (0) 
2 Wed : Quarta-Feira (0) 
3 Thu : Quinta-Feira (0) 
4 Fri : Sexta-Feira (0) 
5 Sat : Sábado (0) 
6 Sun : Domingo (1) 
7 Mon : Segunda-Feira (1) 
8 Tue : Terça-Feira (1) 
9 Wed : Quarta-Feira (1) 
10 Thu : Quinta-Feira (1) 
11 Fri : Sexta-Feira (1) 
12 Sat : Sábado (1) 
13 Sun : Domingo (1) 


Previous Comments:
------------------------------------------------------------------------

[2002-10-10 15:00:31] derick@php.net

sorry, reopening. Can anybody else on BSD verify this? 
Which BSD version do you exactly have?

Derick

------------------------------------------------------------------------

[2002-10-10 11:39:08] davis@suldigital.com.br

and what is this derick?

------------------------------------------------------------------------

[2002-10-10 10:58:17] pguillot@paanjaru.com

Hi,

On a rh7.3 with php 4.1.2 ( from rpm ) the result of the script is ok
:
11 Fri : Sexta-Feira
12 Sat : Sábado
13 Sun : Domingo
14 Mon : Segunda-Feira
15 Tue : Terça-Feira
16 Wed : Quarta-Feira

Patrick

------------------------------------------------------------------------

[2002-10-10 09:35:02] derick@php.net

We are happy to tell you that you just discovered Daylight Savings
Time. For more information see:
http://webexhibits.org/daylightsaving/b.html

------------------------------------------------------------------------

[2002-10-10 09:13:10] davis@suldigital.com.br

I have same code:

<?

function dia_semana($dia, $mes, $ano)
{
	$dia_semana = date("D", mktime(0,0,0,$mes,$dia,$ano));
	switch($dia_semana)
	{
		case "Sun": return "Domingo"; break;
		case "Mon": return "Segunda-Feira"; break;
		case "Tue": return "Terça-Feira"; break;
		case "Wed": return "Quarta-Feira"; break;
		case "Thu": return "Quinta-Feira"; break;
		case "Fri": return "Sexta-Feira"; break;
		case "Sat": return "Sábado"; break;
		default: die("Erro com dia da semana ".$dia_semana);
	}
}

$mes = 10; //month
$ano = 2002; //year

if($mes==2) 
	$dias_mes = 28;
else if($mes==4||$mes==6||$mes==9||$mes==11) 
	$dias_mes = 30;
else
	$dias_mes = 31;
$i=1;
while($i<=$dias_mes)
{		
	if($i==13) echo "<b style='color:red'>";
	echo $i." ".date("D", mktime(0,0,0,$mes,$i,$ano)) . " : ";
	echo $dia_semana = dia_semana($i, $mes, $ano) . "<br>";	
	if($i==13) echo "</b>";
	$i++;
}

?>

output is:

...
11 Fri : Sexta-Feira
12 Sat : Sábado
13 Wed : Quarta-Feira
14 Mon : Segunda-Feira
15 Tue : Terça-Feira
...

can see a exmple in http://www.suldigital.com.br/davis/rodcat/teste.php

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/19847

-- 
Edit this bug report at http://bugs.php.net/?id=19847&edit=1



Thread (9 messages)

« previous php.bugs (#22100) next »