Jump to content

Date Format MS SQL Server 2000 to MySQL


numan82

Recommended Posts

hi to all,

I am having little problem with Date Format, actully I am reading data from MS SQL Server 2000 and inserting into the MySQL.

The Date format of SQL Server 2000 is like 19990120 and MySQL accept the date in the format of

YY-MM-DD,

I tried several function but could not get the solution, I also tried the implode function but it is not working.

any help

thanks in Advance...

Numan

Link to comment
https://forums.phpfreaks.com/topic/92097-date-format-ms-sql-server-2000-to-mysql/
Share on other sites

You can insert a yyyymmdd value directly into a mysql DATE data type -

 

9.3.1. The DATETIME, DATE, and TIMESTAMP Types ...

As a string with no delimiters in either 'YYYYMMDD' or 'YYMMDD' format, provided that the string makes sense as a date. For example, '19970523' and '970523' are interpreted as '1997-05-23', but '971332' is illegal (it has nonsensical month and day parts) and becomes '0000-00-00'.

 

or

 

As a number in either YYYYMMDD or YYMMDD format, provided that the number makes sense as a date. For example, 19830905 and 830905 are interpreted as '1983-09-05'.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.