0

There are two different methods of time that the API response back. I'm looking for the date format in PHP that can bring the Unix timeStamp same.

$d = strtotime("Thu Jun 17 01:18:07 PKT 2021");
$t=strtotime("17/06/2021 01:18 AM");

the above should revert similar unix timeStamp

Waqas
  • 53
  • 4
  • Not exactly sure what you are asking. Does this help? https://stackoverflow.com/questions/2891937/strtotime-doesnt-work-with-dd-mm-yyyy-format – bmb Jun 17 '21 at 20:04
  • use `mktime()` method. – Faizan Ali Jun 17 '21 at 20:13
  • `d/m` is not valid. Either use `06/17` or `17-06` – AbraCadaver Jun 17 '21 at 21:09
  • the payment API returns the above parameters in JSON. I wanted to convert the time so that can be used as a transaction id. there are two json response for 1 payment but differnet date style. I need if I can convert both to unix timestamp to use as timestamp to check invoice duplication – Waqas Jun 18 '21 at 05:08
  • @FaizanAli do I need to explode the time then mktime ? – Waqas Jun 18 '21 at 05:54

0 Answers0