Ver Mensaje Individual
  #5 (permalink)  
Antiguo 22/10/2014, 14:08
julslash
 
Fecha de Ingreso: febrero-2010
Ubicación: valencia
Mensajes: 146
Antigüedad: 14 años, 2 meses
Puntos: 3
Respuesta: Convertir fecha a microtime

Debo decirte que si se puede y lo hice.

desde un principio escribi "necesito transformar la fecha a microtime" (solo la fecha)

en ningun momento dije que necesitaba los milisegundos de una hora en especifica

ya que estas tan seguro de que es imposible y lo reafirmas te enseñare como se hace


Código PHP:
include("conf.php");

 
setlocale(LC_TIME'es_VE'); # Localiza en español es_Venezuela
date_default_timezone_set('America/Caracas');
 
 echo 
"<br>";echo "<br>";
$d10 strtotime('2014-10-19');
 echo 
$d.'00';
 
 
echo 
"<br>";
echo 
"<br>";

//equivale a 1 min despues de la hora aproximadamente 73937

$mil 1413693000000+73937;
$seconds $mil 1000;
$mostrar date('Y:m:d H:i:s'$seconds) ;

echo 
"$mostrar"

y si quieres mostrar varias fechas de una base de datos aqui te dejo el codigo antes que digas que no se puede.....


Código PHP:

include("conf.php");


 
setlocale(LC_TIME'es_VE'); # Localiza en español es_Venezuela
date_default_timezone_set('America/Caracas');
 


$sql="SELECT * FROM fechas order by idFecha";
$result mysql_query($sql);
$row mysql_fetch_array($result); 
$num_resul=mysql_num_rows($result);

echo 
$row['Fecha'];
echo 
"<br>";
$Fech10 strtotime($row['Fecha']);
$Fecha=$Fech.'00';
 echo 
$Fecha+73937;

echo 
"<br>";



while (
$row mysql_fetch_array($result)){

echo 
"<br>";echo "<br>";

echo 
$row['Fecha'];
echo 
"<br>";
$Fech10 strtotime($row['Fecha']);
$Fecha=$Fech.'00';
echo 
$Fecha+73937;
 
echo 
"<br>";



es preferible decir "NO SE" he intentar aprender a prentender creer saberlo todo afirmando algo sin intentarlo


¿Ya?




"Everything is possible" is a term that is easier said than done. It requires a constant influx of ambition, motivation and, more importantly, creativity! But who has that? Great leaders do. Great leaders don’t have all the answers and they are wise enough to know that.

Steve Jobs!