Viewing file: fechanew2.php (2.52 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
//PROBLEMA AGOSTO 01 - FECHA NO Válida
//SOLUCIÓN: antes de hacer el getdate restar un día del timestamp actual para no hacer la resta con la variable dia (mday)
$menosuno=mktime()-86400;
$today = getdate($menosuno);
//$today = getdate();
$month = $today['month'];
$montho = $today['mon'];
//$mday = $today['mday']-1;
$mday = $today['mday'];
$year = $today['year'];
//$wd = $today['wday']-1;
$wd = $today['wday'];
$sing = isset($acc);
if ($sing == true) {
$year = $anox;
$montho = $mesx;
$mday = $diax;
}
if ($sing == true) {
$sh = 0;
if ($acc == "next") {
$tom = mktime(0,0,0,date("$montho") ,date("$mday")+1,date("$year"));
$sh = 1;
}
if ($acc == "prev") {
$tom = mktime(0,0,0,date("$montho") ,date("$mday")-1,date("$year"));
$sh = 1;
}
if ($acc == "igual") {
$tom = mktime(0,0,0,date("$montho") ,date("$mday"),date("$year"));
$sh = 1;
}
if ($sh == 0) {
$tom = mktime(0,0,0,$montho,$mday,$year);
}
$today = getdate($tom);
$montho = $today['mon'];
$month = $today['month'];
$mday = $today['mday'];
$year = $today['year'];
$wd = $today['wday'];
if ($montho < 10) {
$montho = 0 . $montho;
}
if ($mday < 10) {
$mday = 0 . $mday;
}
$fcons = $mday . "/" . $montho . "/" . $year;
}else{
if ($montho < 10) {
$montho = 0 . $montho;
}
if ($mday < 10) {
$mday = 0 . $mday;
}
$fcons = $mday . "/" . $montho . "/" . $year;
}
if ($wd==0) {
$wda = "Domingo";
}
if ($wd==1) {
$wda = "Lunes";
}
if ($wd==2) {
$wda = "Martes";
}
if ($wd==3) {
$wda = "Miércoles";
}
if ($wd==4) {
$wda = "Jueves";
}
if ($wd==5) {
$wda = "Viernes";
}
if ($wd==6) {
$wda = "Sábado";
}?>
<?php
$xmes = $montho;
if ($xmes == 1) {
$lmes = "Enero";
}
if ($xmes == 2) {
$lmes = "Febrero";
}
if ($xmes == 3) {
$lmes = "Marzo";
}
if ($xmes == 4) {
$lmes = "Abril";
}
if ($xmes == 5) {
$lmes = "Mayo";
}
if ($xmes == 6) {
$lmes = "Junio";
}
if ($xmes == 7) {
$lmes = "Julio";
}
if ($xmes == 8) {
$lmes = "Agosto";
}
if ($xmes == 9) {
$lmes = "Septiembre";
}
if ($xmes == 10) {
$lmes = "Octubre";
}
if ($xmes == 11) {
$lmes = "Noviembre";
}
if ($xmes == 12) {
$lmes = "Diciembre";
}
$fechapresentar = $mday . " de " . $lmes . " de ". $year;
//echo $fechapresentar;
?>
|