Setting UTC as the time zone for the the deserialized time field in the dynamic global properties object
This commit is contained in:
parent
457164b002
commit
df5271ef05
1 changed files with 2 additions and 0 deletions
|
@ -11,6 +11,7 @@ import java.lang.reflect.Type;
|
|||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import de.bitsharesmunich.graphenej.GrapheneObject;
|
||||
import de.bitsharesmunich.graphenej.Util;
|
||||
|
@ -70,6 +71,7 @@ public class DynamicGlobalProperties extends GrapheneObject implements Serializa
|
|||
dynamicGlobal.head_block_id = jsonObject.get(DynamicGlobalProperties.KEY_HEAD_BLOCK_ID).getAsString();
|
||||
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat(Util.TIME_DATE_FORMAT);
|
||||
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
try {
|
||||
dynamicGlobal.time = dateFormat.parse(jsonObject.get(DynamicGlobalProperties.KEY_TIME).getAsString());
|
||||
} catch (ParseException e) {
|
||||
|
|
Loading…
Reference in a new issue