Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd27d01a

Browse files
committed
Method to get an event time stamp as milliseconds since the Unix epoch to avoid time zone calculations
1 parent00cff5f commitd27d01a

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

‎.gitignore‎

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,32 @@
1-
.idea/
1+
# Compiled class files
2+
*.class
3+
4+
# Log file
5+
*.log
6+
**/.log
7+
8+
# IntelliJ
29
*.iml
10+
/.idea
11+
12+
# Package Files #
13+
*.jar
14+
*.war
15+
*.nar
16+
*.ear
17+
*.zip
18+
*.tar.gz
19+
*.rar
20+
21+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
22+
hs_err_pid*
23+
24+
# other
25+
/bin/
26+
/.classpath
27+
/.project
28+
/target/
29+
/out/
30+
/.DS_Store
31+
/.settings/
32+

‎src/main/java/io/api/etherscan/model/Log.java‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,25 @@ public LocalDateTime getTimeStamp() {
6060
if(_timeStamp ==null && !BasicUtils.isEmpty(timeStamp)) {
6161
longformatted = (timeStamp.charAt(0) =='0' &&timeStamp.charAt(1) =='x')
6262
?BasicUtils.parseHex(timeStamp).longValue()
63-
:Long.valueOf(timeStamp);
63+
:Long.parseLong(timeStamp);
6464
_timeStamp =LocalDateTime.ofEpochSecond(formatted,0,ZoneOffset.UTC);
6565
}
6666
return_timeStamp;
6767
}
6868

69+
/**
70+
*
71+
* @return
72+
*/
73+
publicLonggetTimeStampAsMillis() {
74+
if (BasicUtils.isEmpty(timeStamp)) {
75+
returnnull;
76+
}
77+
return (timeStamp.charAt(0) =='0' &&timeStamp.charAt(1) =='x')
78+
?BasicUtils.parseHex(timeStamp).longValue()
79+
:Long.parseLong(timeStamp) *1000;
80+
}
81+
6982
publicStringgetData() {
7083
returndata;
7184
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp