Author Topic: The quirks of PHP - mktime  (Read 1171 times)

0 Members and 1 Guest are viewing this topic.

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
The quirks of PHP - mktime
« on: January 19, 2013 »
I've been trying to perfect my PHP Catholic Calendar Generator, and found some odd behaviour in the mktime function - if the timezone is not specified, it will try to guess when to apply BST or DST, messing up the date comparison operations which need to be exact in a script like this - so I defined the timezone as UCT, which is not affected by BST or DST.

On a side note, the Catholic Calendar has more rules than a game of Yu Gi Oh, which makes for an interesting coding challenge.

On another side, maybe we could put together some sort of Demo Scene Calendar for 2014, featuring screen shots of some of our finest effects and demos from previous years. Just an idea.
« Last Edit: January 19, 2013 by combatking0 »
You are our 9001st visitor.
Challenge Trophies Won:

Offline Yaloopy

  • Death From Above
  • DBF Aficionado
  • ******
  • Posts: 2869
  • Karma: 35
    • View Profile
    • UltraPaste
Re: The quirks of PHP - mktime
« Reply #1 on: January 21, 2013 »
Easter's in March? That's really good news. St. Patrick's day being on a Sunday is not so good, though.

This post is all about future days off and is a follow up to my post about having the day off due to snow.
Fuck L. Ron Hubbard and fuck all his clones.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: The quirks of PHP - mktime
« Reply #2 on: January 21, 2013 »
I didn't think of it before, but everyone, not just church-goers, can use this to plan ahead, since many public holidays are based on religious events - at least until 2037, as the server this is on is a 32 bit machine, which causes problems for certain dates in 2038 and beyond.

I've found a possible work-around though.
You are our 9001st visitor.
Challenge Trophies Won: