Senin, Juni 16, 2014

FreeTDS Date Issue on XAMPP Windows

Recently I found that a web application displayed like this, focus on the date (issue date)

while actual data in the database looks like this (phissuedate)

whats went wrong?

This application comprise of Xampp 1.8.2 with apache 2.4.9, php 5.3.28, freetds, ms sql server express 2008 R2, on Windows for sure.

There is locales.conf, also freetds.conf, but they did not solve this issue.

I will make sure the php.ini setting is the issue, should be:

mssql.datetimeconvert = On

to avoid the above wrong date displayed issue.

It seems this is not a freetds issue. It is jqgrid formatting issue.

previous grid field format (i.e slip_grid.js)
{name:'sodscheedule',index:'sodscheedule', width:100,formatter:'date', formatoptions: { newformat:'Y-m-d'}},

the works format

 {name:'sodscheedule',index:'sodscheedule', width:100,formatter:'date', formatoptions: {srcformat:'d/m/Y H:i:s', newformat:'Y-m-d'}},

with locales.conf format
date format = %d/%m/%Y %H:%M

date format = %Y/%m/%d %H:%M
language = us_english
charset = iso_1

So, this issue looks like unmatch grid source format with freetds output date format.

Tidak ada komentar: