Decrypting date

Asked

Viewed 42 times

0

I have a dashboard, and it encrypts the date, and I was wondering how I can decrypt it to show on my website.

Encrypted date: 1437619904

I wanted to put it to the normal way.

  • And the encryption method that is?

  • 3

    This is not the date in seconds since 1970, see here: http://www.epochconverter.com/

  • 1

    That date is Qui 23 Jul 2015 03:51:44 WEST GMT+1:00 DST

1 answer

5


This is the date generated by the function time().

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

You can convert to normal date using the function date():

echo date('m/d/Y H:i:s', 1437619904);
  • Hi Jorge, it’s like, I wanted to pull the date from the database, if I use this code I can pull from the database that date from the time function and put it in the way you organized?

  • Yes, you fetch the database, put it in a variable for example $data_bd and uses: $data_normal = date('m/d/Y H:i:s', $data_bd);

  • Jorge, can I put "$noticias['data']" or something like that in $data_bd? Because I tried and gave error, something that can solve?

  • @Kloves $data_bd = $noticias['data']; date('m/d/Y H:i:s', $data_bd);

  • Jorge gave this error: Notice: A non well Formed Numeric value encountered

  • @Kloves you’re sure to come 1437619904 of the variable $noticias['data']?

  • Jorge I put "echo" on before "$data_db" and appeared only the date, the time did not appear and continued that error. And I’m sure yes.

  • @Kloves makes echo $noticias['data'] what it prints?

  • I pulled the echo out of there and I did what you told me to do only that you continued with the team function.

  • Hello Jorge, I already solved, there is only one thing, as I put it like this: "such' day to "time"? Code: <?php $data_bd = $Edit['data']; $data_actual = date(’m/d/Y H:m:s', $data_bd); ?>

  • @Kloves $data_atual = date('m/d/Y', $data_bd); $hora_atual = date('H:m:s', $data_bd); echo "Dia $data_atual ás $hora_atual";

  • I soon, but I can’t talk in conversation.

  • Everything worked out, thank you!

  • @Kloves of nothing I’m glad I helped :)

Show 9 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.