Skip to content

Commit e2e5a3a

Browse files
lookvincentyangwenyan
andauthored
refactor: 新增当toType是TimeStamp类型时的转换 (#85)
Co-authored-by: yangwenyan <yangwenyan@viewshine.cn>
1 parent 0faafa1 commit e2e5a3a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hsweb-easy-orm-rdb/src/main/java/org/hswebframework/ezorm/rdb/codec/DateTimeCodec.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ public Object decode(Object data) {
115115
if (toType == String.class) {
116116
return DateTimeUtils.format(((Date) data), format);
117117
}
118+
if (toType == Timestamp.class){
119+
return new Timestamp(((Date) data).getTime());
120+
}
118121

119122
return data;
120123
}

0 commit comments

Comments
 (0)