Simple Machines Community Forum

SMF Support => Language Specific Support => Español (Spanish) => Aiheen aloitti: juansrc - joulukuu 22, 2012, 03:44:13 IP

Otsikko: Fechas MYSQL en smf
Kirjoitti: juansrc - joulukuu 22, 2012, 03:44:13 IP
Verán mi consulta no es dificil (creo)

resulta que tengo un foro que quiero unir con una página aparte, y cuando me dirijo a ver cosas como la fecha en la DB de mysql, me encuentro algo como esto



mi pregunta es, en que formato es la encriptacion?

hay un codigo en php, para encriptar las fechas así?
Otsikko: Re: Fechas MYSQL en smf
Kirjoitti: _Newbie_ - joulukuu 22, 2012, 08:49:44 IP
Pues con la función time():

int time ( void )
Returns the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).


Retorna un entero de tamaño 10 (el que se guarda a la base de datos), y para convertirlo al formato de fecha se utiliza la función date():

string date ( string $format [, int $timestamp = time() ] )
Returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given. In other words, timestamp is optional and defaults to the value of time().


Más información time() (http://php.net/manual/en/function.time.php) y date() (http://php.net/manual/en/function.date.php).

Saludos.