logoalt Hacker News

tikotustoday at 11:41 AM4 repliesview on HN

I'm doing PHP for the first time in years. I needed a function that returns the date of last week's Monday. Turns out PHP has a funky date querying language. I can just do: $today->modify('monday last week'). Makes me happy.


Replies

Aachentoday at 5:24 PM

[It has been (1) days since the last time that I needed strtotime]

Don't know how to do this without PHP, so I actually use it on the shell inline between a bunch of Bash. I assume that's the same function with new syntactic sugar

philo23today at 2:24 PM

The relative date formats are super useful. It can get a bit confusing when there's timezones involved though.

https://www.php.net/manual/en/datetime.formats.php#datetime....

is_truetoday at 11:51 AM

PHP is always there for you.

spiderfarmertoday at 12:13 PM

PHP is just awesome.

show 1 reply