mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-07 02:58:43 +00:00
Format AMF dates milliseconds to 3 decimal places
This commit is contained in:
@@ -183,7 +183,7 @@ public class Amf0Exporter {
|
||||
|
||||
if (value instanceof DateType) {
|
||||
DateType dt = (DateType) value;
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("{").append(newLine);
|
||||
sb.append(indent(level + 1)).append("\"type\": \"Date\",").append(newLine);
|
||||
|
||||
@@ -341,7 +341,7 @@ public class Amf3Exporter {
|
||||
+ indent(level) + "}";
|
||||
} else if (object instanceof DateType) {
|
||||
DateType dt = (DateType) object;
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
return "{" + newLine
|
||||
+ indent(level + 1) + "\"type\": \"Date\"," + newLine
|
||||
+ addId
|
||||
|
||||
@@ -367,7 +367,7 @@ public class Amf0Importer {
|
||||
String id = typedObject.containsKey("id") ? typedObject.getString("id") : null;
|
||||
switch (typeStr) {
|
||||
case "Date":
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
String dateStr = typedObject.getString("value");
|
||||
int timeZone = (int) (long) (double) typedObject.getDouble("timezone");
|
||||
try {
|
||||
|
||||
@@ -372,7 +372,7 @@ public class Amf3Importer {
|
||||
String id = typedObject.containsKey("id") ? typedObject.getString("id") : null;
|
||||
switch (typeStr) {
|
||||
case "Date":
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
String dateStr = typedObject.getString("value");
|
||||
try {
|
||||
resultObject = new DateType((double) sdf.parse(dateStr).getTime());
|
||||
|
||||
Reference in New Issue
Block a user