0

Hi,

I have the following dates, either:

- 07-09-09 (which is 7th September 2009)
or
- 07/09/2009 (which is again 7th September 2009)

I need to reformat whichever one of these formats comes up so it
is correctly inserted into myql db via php.

Have tried strpos to find - or / and conditionals to create array of m,y,d and then rejoin in US format in order to use strtotime and then reformat via date into Y-m-d for database.... but that kept crashing the script...i'm a novice so any ideas?

Thanks in advance.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by almostbob
0

dont store a text format date, store a timestamp
timestamp can output to any user's preference
takes only 10bytes to store date and time,
is easier to process for select from - to dates

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.