Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get unix timestamp using php

Tags:

php

timestamp

Suppose i know that today's day is monday. How do i use mktime() in php to get unix timestamp for last friday and the friday before that??

suppose today's date is 17-01-2011 and its a monday. Then i want the timestamp for 14-01-2011 00:00:00 and 7-01-2011 00:00:00.

like image 220
ayush Avatar asked Jan 20 '23 17:01

ayush


1 Answers

check out strtotime http://php.net/manual/en/function.strtotime.php ..solves most of that kinda issues - otherwise you must strap the date yourself

like image 58
Hannes Avatar answered Jan 31 '23 17:01

Hannes