1
I have the following dates:
data atual: 2018-02-11 20:14:40
data expiracao: 2018-02-12 19:57:10
I need to make a comparison between one and the other.
if($dados['transacao']->data_expira <= date("Y-m-d H:i:s")){
echo "Ainda está dentro do prazo";
} else {
echo "Você não pode mais efetuar o pagamento desta cobrança.";
}
Logically, I would be right, but it doesn’t work. He insists on telling me I’m past my deadline. I’ve been using the example posted here in this SPO link:
What can I do to adjust?
Utilize
strtotime($dados['transacao']->data_expira) <= time()
– Valdeir Psr
@Rpgboss Exactly why I put that I’ve used the example and it didn’t work.
– Sr. André Baill
Bring with
echo
orprint_r
the result $data['transaction']->data_expires to see if it really is a date or a string.– RpgBoss
what returns this: $data['transaction']->data_expires?
– novic
@Virgilionovic returns the expiration date, in this format: string(19) "2018-02-12 19:57:10"
– Sr. André Baill