Php missing dates 10 days

Asked

Viewed 149 times

-1

I have a question and would like to know if it is possible in this code instead of showing expired dates show missing dates 10 days to expire.

 if(!empty($row[10]) AND ($row[11] < time() || $row[12] < time() || 
 $row[13] < time() || $row[14] < time() || 
 $row[15] < time() || $row[16] < time() || 
 $row[17] < time())){

Instead of appearing the team that is the current date that is the missing date 10 days.

PS: In the example you put shows me the dates that are already expired. I now just want to show the dates whose date is missing 10 days to expire.

  • 4

    Clarify your specific issue or add other details to highlight exactly what you need. The way it’s written here, it’s hard to know exactly what you’re asking. See the [Ask] page for help clarifying this question.

  • I didn’t quite understand the question. but want to get the date 10 days before the current date? For example, today is day 6-08-2014, want to receive 27-07-2014????

  • Exactly. Search 10 days before

  • View functions Date/Time of PHP

1 answer

1

Let’s imagine that the date is 2014-07-29, to fetch 10 days behind this date just do the following:

   <?php
       //Precisa de definir a função abaixo para evitar warnings
       date_default_timezone_set('America/Los_Angeles');
       //Sua data original
       $Date = "2014-07-29";
       //Modifica a data (10 dias atrás) 
       $data_actual = date('Y-m-d', strtotime($Date. ' - 10 days'));
       //Mostra resultado
       echo $data_actual;
    ?>

Browser other questions tagged

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