File tree 1 file changed +6
-4
lines changed
src/main/java/io/api/etherscan/model
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -67,16 +67,18 @@ public LocalDateTime getTimeStamp() {
67
67
}
68
68
69
69
/**
70
- *
71
- * @return
70
+ * Return the "timeStamp" field of the event record as a long-int representing the milliseconds
71
+ * since the Unix epoch (1970-01-01 00:00:00).
72
+ * @return milliseconds between Unix epoch and `timeStamp`. If field is empty or null, returns null
72
73
*/
73
74
public Long getTimeStampAsMillis () {
74
75
if (BasicUtils .isEmpty (timeStamp )) {
75
76
return null ;
76
77
}
77
- return (timeStamp .charAt (0 ) == '0' && timeStamp .charAt (1 ) == 'x' )
78
+ long tsSecs = (timeStamp .charAt (0 ) == '0' && timeStamp .charAt (1 ) == 'x' )
78
79
? BasicUtils .parseHex (timeStamp ).longValue ()
79
- : Long .parseLong (timeStamp ) * 1000 ;
80
+ : Long .parseLong (timeStamp );
81
+ return tsSecs * 1000 ;
80
82
}
81
83
82
84
public String getData () {
You can’t perform that action at this time.
0 commit comments