fixed time zone for CSV Export

This commit is contained in:
anhefti 2022-01-06 16:23:17 +01:00
parent f0afa473fd
commit 863511dbc7
3 changed files with 6 additions and 3 deletions

View file

@ -90,6 +90,9 @@ public final class Constants {
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
public static final DateTimeFormatter STANDARD_DATE_TIME_MILLIS_FORMATTER = DateTimeFormat
.forPattern(DEFAULT_DATE_TIME_MILLIS_FORMAT)
.withZoneUTC();
public static final DateTimeFormatter STANDARD_DATE_TIME_FORMATTER = DateTimeFormat
.forPattern(DEFAULT_DATE_TIME_FORMAT)
.withZoneUTC();

View file

@ -244,7 +244,7 @@ public final class Utils {
}
public static String formatDate(final DateTime dateTime) {
return dateTime.toString(Constants.DEFAULT_DATE_TIME_MILLIS_FORMAT);
return dateTime.toString(Constants.STANDARD_DATE_TIME_MILLIS_FORMATTER);
}
public static Long dateTimeStringToTimestamp(final String startTime, final Long defaultValue) {

View file

@ -120,7 +120,7 @@ public class SEBClientEventCSVExporterTest {
final String string = Utils.toString(array);
Assert.assertEquals(
"INFO_LOG,\"text\",5,1970-01-01T00:00:00.003,1970-01-01T00:00:00.004,\"name\",\"description\",BYOD,1970-01-01T01:00:00.001,1970-01-01T01:00:00.001\n",
"INFO_LOG,\"text\",5,1970-01-01T00:00:00.003,1970-01-01T00:00:00.004,\"name\",\"description\",BYOD,1970-01-01T00:00:00.001,1970-01-01T00:00:00.001\n",
string);
}
@ -142,7 +142,7 @@ public class SEBClientEventCSVExporterTest {
final String string = Utils.toString(array);
Assert.assertEquals(
"INFO_LOG,\"text\",5,1970-01-01T00:00:00.003,1970-01-01T00:00:00.004,\"sessionid\",\"clientaddress\",status,token,\"name\",\"description\",BYOD,1970-01-01T01:00:00.001,1970-01-01T01:00:00.001\n",
"INFO_LOG,\"text\",5,1970-01-01T00:00:00.003,1970-01-01T00:00:00.004,\"sessionid\",\"clientaddress\",status,token,\"name\",\"description\",BYOD,1970-01-01T00:00:00.001,1970-01-01T00:00:00.001\n",
string);
}
}