Welcome Guest, Not a member yet? Register   Sign In
Basic date formatting problem:
#1

[eluser]Sanity11[/eluser]
Hi all,

I have a question about formatting dates.

In my database I have two fields for DATE.
The date's in the database are formatted as follows: 2009-06-01. In the Netherlands it should be like this: 01-06-2009. To show it like that I have made the following:

Code:
<tr>
                                    <td>
                                        Start Datum:
                                    </td>
                                    <td>
                                        &lt;?php $time_start = human_to_unix($query[0]->start_date); echo mdate($datestring, $time_start); ?&gt;
                                        &lt;?=$query[0]->start_date?&gt;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Eind Datum:
                                    </td>
                                    <td>
                                        &lt;?php $time_end = human_to_unix($query[0]->end_date); echo mdate($datestring, $time_end); ?&gt;
                                        &lt;?=$query[0]->end_date?&gt;
                                    </td>
                                </tr>

This however result's in:

Code:
<tr>
                                    <td>
                                        Start Datum:
                                    </td>

                                    <td>
                                        01-06-2009                                        2009-06-01                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Eind Datum:
                                    </td>
                                    <td>
                                        01-06-2009                                        2029-06-08                                    </td>

                                </tr>

As you can see the date processed is always: 01-06-2009 ...?
Can someone help me do this correctly?


Messages In This Thread
Basic date formatting problem: - by El Forum - 06-01-2009, 10:29 AM
Basic date formatting problem: - by El Forum - 06-01-2009, 11:22 AM
Basic date formatting problem: - by El Forum - 06-01-2009, 11:46 AM
Basic date formatting problem: - by El Forum - 06-01-2009, 11:46 AM
Basic date formatting problem: - by El Forum - 06-01-2009, 11:52 AM
Basic date formatting problem: - by El Forum - 06-01-2009, 12:14 PM
Basic date formatting problem: - by El Forum - 06-02-2009, 12:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB