Skip to content

Commit

Permalink
fix(analytics): use correct timezone when extracting timestamp from csv
Browse files Browse the repository at this point in the history
Resolves #1924
  • Loading branch information
jo-elimu committed Oct 30, 2024
1 parent f3810d8 commit 8916fc0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.util.Arrays;
import java.util.Calendar;
import java.util.List;
import java.util.TimeZone;

import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
Expand Down Expand Up @@ -137,7 +139,7 @@ public static List<VideoLearningEvent> extractVideoLearningEvents(File csvFile)
VideoLearningEvent videoLearningEvent = new VideoLearningEvent();

long timestampInMillis = Long.valueOf(csvRecord.get("timestamp"));
Calendar timestamp = Calendar.getInstance();
Calendar timestamp = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
timestamp.setTimeInMillis(timestampInMillis);
videoLearningEvent.setTimestamp(timestamp);

Expand Down

0 comments on commit 8916fc0

Please sign in to comment.