From ae9077a5d970c73b00f88c63f24b5158f989f9b0 Mon Sep 17 00:00:00 2001 From: Oguzhan Unlu Date: Fri, 22 Dec 2017 12:56:03 +0300 Subject: [PATCH] igluctl: use UTC in header generation of Redshift DDL files (close #223) --- .../com.snowplowanalytics.iglu/ctl/GenerateCommand.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/0-common/igluctl/src/main/scala/com.snowplowanalytics.iglu/ctl/GenerateCommand.scala b/0-common/igluctl/src/main/scala/com.snowplowanalytics.iglu/ctl/GenerateCommand.scala index d02493ac..b5d53279 100644 --- a/0-common/igluctl/src/main/scala/com.snowplowanalytics.iglu/ctl/GenerateCommand.scala +++ b/0-common/igluctl/src/main/scala/com.snowplowanalytics.iglu/ctl/GenerateCommand.scala @@ -14,8 +14,8 @@ package com.snowplowanalytics.iglu.ctl // Java import java.io.File -import java.text.SimpleDateFormat -import java.util.Calendar +import java.time.{ZoneOffset, ZonedDateTime} +import java.time.format.DateTimeFormatter // Iglu Core import com.snowplowanalytics.iglu.core.SchemaMap @@ -143,7 +143,7 @@ case class GenerateCommand( def redshiftDdlHeader = CommentBlock(Vector( s"AUTO-GENERATED BY ${generated.ProjectSettings.name} DO NOT EDIT", s"Generator: ${generated.ProjectSettings.name} ${generated.ProjectSettings.version}", - s"Generated: ${new SimpleDateFormat("YYYY-MM-dd HH:mm").format(Calendar.getInstance.getTime)}" + s"Generated: ${ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))} UTC" )) // Header section with additional space