How can we help you?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Handling dates in JSON and Gilhari

edited July 7 in Gilhari

A date is represented as long (the number of milliseconds for this date since the epoch, which is defined as the midnight at the beginning of January 1, 1970,) in a JSON object since there is no standard JSON string format for date representation. So, you have to send the milliseconds equivalent value of your date attribute in the JSON object.

However, you may still use a SQL column type of "Date" for this attribute at the database level.

In the mapping file, specify a SQL data type of "Date" for the attribute (e.g., DOB) in a SQLMAP statement. For example,

SQLMAP FOR DOB SQLTYPE Date

Gilhari would automatically translate between the "long" JSON value and the Date column value for DOB. When you access the database (e.g., MySQL) directly, you should see the DOB value in a proper date format.

Comments

Sign In or Register to comment.