From af22217f509a167f99b8c042cca97ebd5d2069fd Mon Sep 17 00:00:00 2001 From: Michael Simard Date: Tue, 16 Jun 2020 18:55:06 -0500 Subject: [PATCH] time experiment --- Sources/App/Controllers/StatsController.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/App/Controllers/StatsController.swift b/Sources/App/Controllers/StatsController.swift index 34562a7..c11e503 100644 --- a/Sources/App/Controllers/StatsController.swift +++ b/Sources/App/Controllers/StatsController.swift @@ -364,6 +364,7 @@ struct StatsController: RouteCollection { let calendar = Calendar.current var components = DateComponents() + components.timeZone = TimeZone(identifier: "America/New_York")! components.day = 20 components.month = 03 components.year = 2020 @@ -375,13 +376,13 @@ struct StatsController: RouteCollection { private func createDate(day:Int, month:Int, year:Int) -> Date { let calendar = Calendar.current + var components = DateComponents() components.day = day components.month = month components.year = year - components.hour = 0 - components.minute = 0 + return calendar.date(from: components)! }