Blog

  • Easy Way to Convert UTC to Current Timezone in PHP


    $utc_time = "2009-01-12 21:28:21"; // As pulled from the database
    date_default_timezone_set("America/New_York"); // Set to Eastern time (automatically handles daylight savings time)

    // Here's the secret: add a Z (for zulu) to the end of your UTC date/time string
    $utc_time .= "Z";

    // Now convert to the current timezone
    $cur_date = strftime("%G-%m-%d %H:%M:%S", strtotime($utc_time)); // Format as YYYY-MM-DD HH:MM:SS


    The result: 2009-01-12 16:28:21

    How do you handle this? Let me know in the comments.

    Share
  • Presenting Stock Rider :: Ski the Market

    stock-rider-screen-shot

    Play Now

    Today is very special. After 150 hours of hard work and sleepless nights, I have released Stock Rider, a flash-based game where you ski real market data.

    This is my first big Flash piece and I am so happy with the results. It uses Box2D for Flash as the physics engine, incorporates sounds, side-scrolling, high score submitting, pulling external data, and so much more. Please take a few minutes to check it out…it’s really quite fun. If you can’t get the hang of it, let me know in the comments and I’ll see if I can help you out.

    Play Now

    A special thanks goes out to the following people:
    Scott Scaggs
    Taryl Fultz
    Mark Rickert
    Derek Lidbom

    Share
  • I Feel Like a Cannibal

    Root CanalToday I had the strangest experience ever. My dentist decided I needed a root canal so I went to the endodontist to have the operation. They put a rubber dam around the tooth which was no fun because it covered my mouth, so my only breathing option was through my nose.

    As the doctor began drilling, a cloud of bone dust and bone chips filled the air. Because of the position in which I was situated, my choice was to breathe in this horrific material or suffocate. I reluctantly inhaled the dust and was utterly disgusted by both the smell and how it clogged my nose, making it even harder to breathe. This carried on for a good four or five minutes. After the drilling subsided I exhaled forcefully through my nose and a spray of white dust covered the protective apron I was wearing.

    While the operation wasn’t painful…yet (my anesthetics are still working)…it was such a strange sensation breathing my own body in and out. I wouldn’t wish that on anyone. Yuuuuuuck!

    Share
  • Quote of the Day

    “When I hear somebody say, Life is hard, I am always tempted to ask, Compared to what?”

    — Sydney J. Harris

    Share
  • Quote of the Day

    I got to listen in to a hilarious game of 20 Questions today.

    Derek: Do I eat it?
    Jon: No.
    Derek: Then how is it going to make my day?

    Share