Date Format from MySQL with PHP to JSON to DataSource to Date Field

Hi,

It’s Ric Yik. I would like to ask how is the date handling for transmissing the date value:

  1. From MySQL in PHP to JSON
  2. From JSON to DSResponse
  3. From DSResponse to Field
  4. From Field to DSRequest

During development, I found that the date value cannot pass correctly to the Field such that the Date Field only show the current date instead of the correct value.

Here attaches my fetch JSON Message for reference:
{“response”:{“status”:0,“data”:[{“create_date”:“2008-05-28 17:39:43”,“create_user”:“1”}]}}

In PHP, I use json_encode to encode the associative array from mysql_fetch_array(), where the result is an associative array as column => value pairs.

Thanks
Ric Yik

Hi Ric Yik,

Your date value in your fetch message looks fine. Most likely, the name of the field in the data returned “create_date” does not match the name of the field in the DataSource or in the form where you are currently displaying it.