Allow textual datetime description as input for timestamp and reference #1

Merged
merged 1 commit into from Apr 19, 2012

Conversation

Projects
None yet
2 participants
Contributor

akDeveloper commented Apr 18, 2012

It would be nice to pass a textual datetime too, like a database timestamp.

Please replace ? $timestamp : with ?:, that's allowed since PHP 5.3. Then it's all good and I'll merge it.

Owner

akDeveloper replied Apr 19, 2012

Using ?:, if $timestamp is a number then will take the value of 1, the result of is_numeric($timestamp) comparison.
I was thinking of replacing is_numeric with is_int since, i think that there is not float unix timestamp

ah, right about ?:. is_numeric however also works for stringular numbers, which is why I'd keep is_numeric

Owner

akDeveloper replied Apr 19, 2012

Yes you are right, is_numeric will work with stringular numbers, special if these numbers come from a mysql database

@cweiske cweiske added a commit that referenced this pull request Apr 19, 2012

@cweiske cweiske Merge pull request #1 from akDeveloper/master
Allow textual datetime description as input for timestamp and reference
c46426b

@cweiske cweiske merged commit c46426b into pear:master Apr 19, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment