- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Edit Admin
PHP's Unix time is the number of seconds since Unix Epoch, like everybody else.
Admin
Yes. But given that this is PHP we are talking about readers would be excused for being surprised about that fact.
Edit Admin
This function has the effect of flooring to second. It's a terrible way to do that, but it's not a no-op.
Edit Admin
Except when it shouldn't.
Of course, changing the default timezone can be a WTF in and of itself...
Admin
PHP and WTF have the same character count. Coincidence? Or is it maybe inspiration? Could our ancestors have been inspired to create PHP by access to extraterrestrial knowledge? Could its many insane and idiotic idiosyncrasies be nothing but errors in translation resulting from our inability to understand advanced alien programming paradigms?
See this and more as we reveal the ultimate truth in the next episode of Ancient Programmers.
Admin
LZ79LRU and TROLL do not have he same character count, but they come close.
Edit Admin
time()
returns the time as an integer number of seconds, so it's already floored.Edit Admin
Interesting, I thought it's usually in milliseconds. Oh well, still a giant WTF.
Admin
I'd like to take the opportunity to share my favourite
atd
"feature":Yes, it understands almost any time spec, including "at teatime", but not the one format it emits.
Edit Admin
What this function is returns a new timestamp that forces the epoch to be 1970-01-01 00:00:00 in the current timezone (whatever that has been configured to be). So if your timezone is at UTC-8 then
yourTime()
(no way is it myTime()) would return a timestamp that is 28800 less than the Unix timestamp.In other words: it takes the Unix timestamp, subtracts the current timezone's offset from UTC, and returns the result.
Addendum 2024-10-17 02:41: Adds, subtracts: depends on which side you're looking at it from.
Admin
"Thank you for sharing this update on the revamped SafetyWing Nomad Insurance claim process! I really appreciate the focus on making it easier and more efficient for travelers. Having reliable and hassle-free insurance is so important for digital nomads, and this is a great step forward. Your post is super helpful!"
"Thank you for sharing this update on the revamped SafetyWing Nomad Insurance claim process! I really appreciate the focus on making it easier and more efficient for travelers. Having reliable and hassle-free insurance is so important for digital nomads, and this is a great step forward. Your post is super helpful!"