I am using gson 2.8
for serialization and deserialization I have OffsetDateTime
field in my class when I give the value "orderTime":"2018-05-02T14:23:00Z"
I am getting it as "2018-05-02T14:23Z"
where I am expecting "2018-05-02T14:23:00Z"
if I give "orderTime":"2018-05-02T14:23:01Z"
I am getting as expected "2018-05-02T14:23:00Z"
. Is there anyway to fix this issue?
Here is my Order Class
import com.google.gson.annotations.SerializedName;
import java.time.OffsetDateTime;
public class Order {
@SerializedName("orderId")
private String orderId = null;
@SerializedName("orderType")
private String orderType = null;
@SerializedName("orderTime")
private OffsetDateTime orderTime = null;
....
}