Skip to content

Commit

Permalink
fix: let DateTime to be valid
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenglinli committed Jul 31, 2023
1 parent 6e8e078 commit 9cbfbcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sqlancer/stonedb/ast/StoneDBConstant.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public StoneDBDateConstant(long val) {
if (validValue < -30609820800000L) {
validValue = -30609820800000L;
}
Timestamp timestamp = new Timestamp(val);
Timestamp timestamp = new Timestamp(validValue);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
textRepr = dateFormat.format(timestamp);
}
Expand Down Expand Up @@ -178,7 +178,7 @@ public StoneDBTimestampConstant(long val) {
if (validValue < -30609820800000L) {
validValue = -30609820800000L;
}
Timestamp timestamp = new Timestamp(val);
Timestamp timestamp = new Timestamp(validValue);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
textRepr = dateFormat.format(timestamp);
}
Expand Down

0 comments on commit 9cbfbcd

Please sign in to comment.