Jump to content
AnaSilva

[Resolvido] Erro no mktime()

Recommended Posts

AnaSilva

Olá >.< bem é assim eu tenho um erro a dar no mktime() que é

Notice: A non well formed numeric value encountered in D:\wamp\www\projet_estagio\config\gantt\gantt_principal.php on line 110

<?php
while($registo=mssql_fetch_array($resultado))
{
//data inicial
$datainicio1=$registo['dat_inicio'];
$diain=substr($datainicio1,0,2); //$dia
$mesin=substr($datainicio1,3,2);//$mes
$anoin=substr($datainicio1,6,4);//$ano
$horain=substr($datainicio1,11,2);//$hora
$minin=substr($datainicio1,14,2);//minuto
$segin=substr($datainicio1,17,2);//Segundo
//data final
$datafim1=$registo['dat_fim'];
$diafi=substr($datafim1,0,2); //$dia
$mesfi=substr($datafim1,3,2);//$mes
$anofi=substr($datafim1,6,4);//$ano
$horafi=substr($datafim1,11,2);//$hora
$minfi=substr($datafim1,14,2);//minuto
$segfi=substr($datafim1,17,2);//Segundo
$valumin=($tempo-mktime($horafi, $minfi,$segfi,$mesfi,$diafi, $anofi))/(60*60*24);
$ValueMax=($tempo-mktime($horain, $minin,$segin,$mesin,$diain, $anoin))/(60*60*24);
}
?>

e a linha 110 é

$ValueMax=($tempo-mktime($horain, $minin,$segin,$mesin,$diain, $anoin))/(60*60*24);

quando eu ponho só uma linha com o mktime da tudo direito mas kuando ponho 2 da-me erro podem me ajudar please ? =( ja vi as variaveis estao todas certas

Edited by AnaSilva

Share this post


Link to post
Share on other sites
HappyHippyHippo
while($registo=mssql_fetch_array($resultado))
{
 $valumin = ($tempo - strtotime($registo['dat_inicio'])) / (60*60*24);
 $valumax = ($tempo - strtotime($registo['dat_fim'])) / (60*60*24);
}

  • Vote 1

IRC : sim, é algo que ainda existe >> #p@p

Share this post


Link to post
Share on other sites
AnaSilva

sério O-o ? xD fogooo eu vi essa função do strtotime() e nao consegui usa-la.... bem eu nao ussei-a assim por isso é k dava mal com essa funçao tbm >.< T,T kkkkkkkkkkkkkkkk

mt obrigado happy por me ajudares *-*

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.