11.09.2018 Views

Aprender a desarrollar un sitio Web con PHP y MySQL

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

24/4/2014 ENI Training - Libro online<br />

Hoy: 01-02-2013, Próxima semana: 08-02-2013<br />

La f<strong>un</strong>ción mktime() devuelve el timestamp UNIX desde <strong>un</strong>a fecha que se pasa como<br />

parámetro.<br />

Por ejemplo:<br />

<br />

Da como resultado:<br />

1328050800<br />

Su sintaxis es:<br />

$timestamp = mktime($hora,$minuto,$seg<strong>un</strong>do,$mes,$día,$año)<br />

Esta f<strong>un</strong>ción corrige los datos no válidos automáticamente. Por ejemplo, 32 de Enero se<br />

corregirá como 1 de Febrero.<br />

La f<strong>un</strong>ción microtime() devuelve el timestamp UNIX en microseg<strong>un</strong>dos. Como parámetro<br />

opcional utiliza <strong>un</strong> booleano, que permite devolver <strong>un</strong> número real si es verdadero, o <strong>un</strong>a<br />

cadena de caracteres si no lo es.<br />

Por ejemplo:<br />

<br />

Da como resultado:<br />

0.31211200 1328104356<br />

1328104356.3121<br />

0.3121<br />

Por tanto, su sintaxis es:<br />

$microseg<strong>un</strong>do = microtime($bool)<br />

La f<strong>un</strong>ción getdate() devuelve <strong>un</strong>a tabla asociativa de la fecha y la hora actuales.<br />

http://www.eni-training.com/client_net/mediabook.aspx?idR=87315 3/7<br />

www.FreeLibros.me

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!