Skip to content

Commit f2f1296

Browse files
authored
Merge pull request DeBortoliWines#52 from BT-aestebanez/master
[FIX] Dates should not take into account the timezone Great thanks for this great contribution. We also experienced such issues and thanks for the compliment. BTW, do you use the odoo step available in the Pentaho Kettle?
2 parents eb023fa + 74d948b commit f2f1296

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/odoojava/api/Row.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public Object get(String fieldName){
130130

131131
if (value instanceof String && fieldType == Field.FieldType.DATE){
132132
DateFormat dfm = new SimpleDateFormat("yyyy-MM-dd");
133+
dfm.setTimeZone(TimeZone.getTimeZone("UTC"));
133134
try{
134135
return dfm.parse(value.toString());
135136
}
@@ -140,6 +141,7 @@ public Object get(String fieldName){
140141

141142
if (value instanceof String && fieldType == Field.FieldType.DATETIME){
142143
DateFormat dfm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
144+
dfm.setTimeZone(TimeZone.getTimeZone("UTC"));
143145
try{
144146
return dfm.parse(value.toString());
145147
}

0 commit comments

Comments
 (0)