datepicker date format for european use and date conversion in the table field
Does anybody have an idea how I can resolve the following problem in PowerStore 3 coupons_Insert.php and couons_Update.php to store the CouponStartDate and the CouponEndDate with the format required by the corresponding field in the coupons table.
As I needed to localize PW3 to French (and later to German) I had to modify the jquery-ui-1.7.1.custom.min.js file in CSSFormBuilder according to the instructions published on the jQUERY site (UI/Datepicker/formatDate) for the datepicker function and so on, to be able to use the European date input (dd/mm/yy) (e.g. 24 mars 2010 for 24th march 2010)
I also modified the CouponStartDate_Spry and the CouponEndDate_Spry to format:'dd/mm/yyyy'.
Everything works fine on the page in the browser. The datepicker reacts as it should for European date and stores e.g. 28/03/2010 (for 28th march 2010). It validates correctly in the form field on the screen.
But when it comes to store that date into the field of the database (MySQL), then the date stored is 01/01/1970, which in turn indicate that the .((isset($_POST["CouponStartDate"]))?date('Y-m-d',strtotime($_POST["CouponStartDate"])):"") ."" function in the query of coupons_Insert.php did not work fine.
Some type of string conversion or manipulation must be done (and furthermore also in coupons_Update.php) to store the date with the format needed in the table’s date field.
Should I issue a mysql_query("SET lc_time_names = 'fr_FR'"); before runnin the actual query. I’m not sure that it will solve my problem.
Any help is welcome