Announcement

GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? WE LIVE INSIDE A DREAM. GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? GOOGLE CHROME IS A BOTNET? NO MORE SPAM
FRIENDLY REMINDER THAT THE FORUMS ARE DEAD AND THAT THE LIFE OF THE PARTY CURRENTLY RESIDES IN #FAIL #EEFORUMSANARCHY #EEFORUMS #hi ON RIZON.

YO RIZON #HI
it's closing time you don't have to go home but you can't stay here

Advertisement

#1 2014-02-02 20:12:14

Different55
The Beanmaker
Registered: 2011-05-18
Posts: 9,143
Fails: 0

strtotime is the best function ever

strtotime is the best function ever. In any language. I mean, just look at this code:

<?php echo date('m/d/Y h:i:s', strtotime('next tuesday')); ?>

RESULT: 02/04/2014 12:00:00

It gives you the date down to the second of any time-y string you want. It's amazing. People have made shrines to this function. Here's one: http://www.strtotime.net/

Seriously. It's that amazing.


Jet fuel can't make dank memes.

Offline

#2 2014-02-02 22:28:40

Ratburntro44
Member
Registered: 2011-10-28
Posts: 3,370
Fails: 100,959

Re: strtotime is the best function ever

I have no idea how I never knew this existed.


31
SEfX29x.png

Offline

#3 2014-02-02 22:48:21

Different55
The Beanmaker
Registered: 2011-05-18
Posts: 9,143
Fails: 0

Re: strtotime is the best function ever

I used to be like you. Wandering around php sites thinking "lol unix timestamps are teh sux0rz."

But then I found strtotime. I am absolutely chuffed to bits with it. Since I first discovered it earlier today my quality of life has increased tenfold and my stress levels when dealing with time in code have dropped to record lows.

On a more serious note, this function really does make dealing with dates and times a lot easier. The posts per hour mod I made for the forum uses strtotime to get the timestamp of 'Last Monday' and 'Midnight today'. It's a lot easier to write and a lot easier to read than other ways to do the same thing.


Jet fuel can't make dank memes.

Offline

Board footer

Jump to

We use Fail. Fail uses FluxBB

[ Generated in 0.014 seconds, 21 queries executed - Memory usage: 551.84 KiB (Peak: 574.05 KiB) ]