cp56time2a decode stick to the doc

This commit is contained in:
ZZ 2022-05-02 18:13:26 +08:00
parent fbe4f6772e
commit 35b3adf639

View File

@ -19,7 +19,7 @@ public class CP56Time2a {
int milliseconds = HexUtils.reverseHexInt(hex.substring(0, 4));
int minutes = bytes[2] & 0x3f;
int hours = bytes[3] & 0x1f;
int days = bytes[4] & 0x3f;
int days = bytes[4] & 0x1f;
int months = bytes[5] & 0x0f;
int years = bytes[6] & 0x7f;
DateTime dt = new DateTime();
@ -218,8 +218,9 @@ public class CP56Time2a {
// System.out.println(String.format("--未编码--: %s", time));
// String hex = toCp56Hex(time);
// System.out.println("--编码1--:" + hex);
System.out.println(HexUtils.toBinaryString("CA600D173F0116"));
System.out.println("--下达1--:" + DateUtil.format(cp56toDate("C05D0D171F0116"), NORM_DATETIME_FORMATTER));
System.out.println(HexUtils.toBinaryString("90E223133D0416"));
System.out.println("--下达1--:" + DateUtil.format(cp56toDate("38443B161D0416"), NORM_DATETIME_FORMATTER));
System.out.println("--下达2--:" + DateUtil.format(cp56toDate("384A34171D0416"), NORM_DATETIME_FORMATTER));
System.out.println("toCp56Hex = " + toCp56Hex(cp56toDate("C05D0D171F0116")));
// System.out.println("--下达2--:" + DateUtil.format(cp56toDate(""), NORM_DATETIME_FORMAT));
String dateStr = "2017-03-01 22:33:23";