Friday 21 November 2014

PHP: a survey about date data handling

I'm just going to regurgitate the intro paragraph to the survey ( here:

I'm in the process of teaching myself PHP, having come from a CFML background. One topic that came up in conversation yesterday was how to store dates in memory (ie: in a variable). In CFML we'd use a date object. It seems in PHP there are a number of common options: using an integer in the guise of a "Unix timestamp" or using a DateTime object being two options. I'm just wondering what people tend to do here.

That's it really. It's just one question, and a comment box:

1. During the lifecycle of a date value, from being a string passed from a form or URL parameter, through being used in programming logic then ultimately output in an HTML document, how do you tend to store the date data?

(with options for "original string", "unix timestamp", "DateTime object", "Other").

If you use PHP or can pass this on to someone who does, I'd really appreciate it.

The survey URL again:

Right... I've got some Python to read...