Welcome Guest, Not a member yet? Register   Sign In
Code needed to convert human date input from web form to UNIX timestamp
#1

[eluser]edziffel[/eluser]
Needed is a solution to take human date input from a web page form and convert it to a UNIX timestamp.

The application stores all date/time data in the database as a UNIX timestamp using the PHP function time() with the intent of making the code more portable for differing databases-read engineering Oracle out of the equation. The human input will be only mm/dd/yyyy (no hours min etc.) or some iteration of that depending on further reasearch, but still must be stored in the db as a Unix timestamp. The human inputted timestamps need to be searchable in day increments and human backdating and postdating will be allowed.

Questions:
1. Can/how does one use the human_to_unix() function for such a requirement?
2. Are there other approaches that would work better?

Thanks,

Ed


Messages In This Thread
Code needed to convert human date input from web form to UNIX timestamp - by El Forum - 06-20-2009, 06:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB