It looks like you're new here. If you want to get involved, click one of these buttons!
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.
Copyright © 2024 Software Tree, LLC. All rights reserved.
Comments
The milliseconds value may be negative for dates before 1970.
Milliseconds in java/android before 1970?
Convert python datetime to timestamp in milliseconds