• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
date / time help

#1
hello, i have something this but dont know how make it for month *check/reset every month, (i tried something but i don't know how test it, cannot wait for end of month) can someone help me remake it for months? (reset every month) Angel

Code:
public function getWeekStartEnd()
    {
           $ts = time();
        

        if (date('w', $ts) == 1)
        {
            $start = strtotime('today', $ts);
        }
        else
        {
            $start = strtotime('this week last monday', $ts);
        }
    
        if (date('w', $ts) == 0)
        {
            $end = strtotime('today', $ts);
        }
        else
        {
            $end = strtotime('this week next sunday', $ts);
        }
        
     
        return array(date('Y-m-d H:i', $start), date('Y-m-d H:i', $end + 60*60*23 + 60*59));
    }
Reply


Messages In This Thread
date / time help - by ninja258 - 03-22-2019, 12:36 PM
RE: date / time help - by Wouter60 - 03-22-2019, 02:45 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.