MsSQL

Hi,

I use MsSQL server. I created an application in PHP who uses a field
type datetime. When I tested it local it worked fine, the datetime
field has this format: mm/dd/yyyy. When I tested it on another server I
remarked that the same field datetime has format dd/mm/yyyy. How can I
change it to mm/dd/yyyy.
iulian.ilea [ So, 08 Oktober 2006 18:30 ] [ ID #1493038 ]

Re: MsSQL

iulian.ilea [at] gmail.com wrote:

> Hi,
>
> I use MsSQL server. I created an application in PHP who uses a field
> type datetime. When I tested it local it worked fine, the datetime
> field has this format: mm/dd/yyyy. When I tested it on another server I
> remarked that the same field datetime has format dd/mm/yyyy. How can I
> change it to mm/dd/yyyy.
>
I'd recommend you store the date as yyyy-mm-dd, which is unambiguous.
Mick
Mick White [ Mo, 09 Oktober 2006 22:18 ] [ ID #1494168 ]

Re: MsSQL

iulian.ilea [at] gmail.com wrote:

> Hi,
>
> I use MsSQL server. I created an application in PHP who uses a field
> type datetime. When I tested it local it worked fine, the datetime
> field has this format: mm/dd/yyyy. When I tested it on another server I
> remarked that the same field datetime has format dd/mm/yyyy. How can I
> change it to mm/dd/yyyy.

MySQL stores dates in an internal format that looks nothing like dd or
mm or yyyy.

When you perform a query, you can decide how you want a date formatted
by using the DATE_FORMAT() function.

See: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functio ns.html
Captain Paralytic [ Do, 12 Oktober 2006 14:39 ] [ ID #1498188 ]
PHP » alt.php.sql » MsSQL

Vorheriges Thema: Searching a tool [like XAMPP on linux] of linux/apache/pgsql/php installer
Nächstes Thema: Help with query...