Skip to content

Commit

Permalink
Add the UTC+1 Offer directly to the initial dateComponents.hour value
Browse files Browse the repository at this point in the history
  • Loading branch information
mulot committed Jun 5, 2022
1 parent b3d9b43 commit 99975c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Binary file not shown.
8 changes: 5 additions & 3 deletions BeatTime/BeatTime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class BeatTime: NSObject {
dateComponents.month = calendar.component(.month, from: date)
dateComponents.day = calendar.component(.day, from: date)
dateComponents.timeZone = TimeZone(abbreviation: "CET")
dateComponents.hour = 0
dateComponents.hour = 1 // UTC+1 Offset
dateComponents.minute = 0
/*
if (TimeZone.autoupdatingCurrent.isDaylightSavingTime()) {
Expand All @@ -62,9 +62,11 @@ class BeatTime: NSObject {
else {
print("Daylight Off")
}
*/
*/

if let someDateTime = calendar.date(from: dateComponents) {
let secondsSinceRefDate = someDateTime.timeIntervalSinceReferenceDate + BeatTime.UTCplus1Offset + seconds
//let secondsSinceRefDate = someDateTime.timeIntervalSinceReferenceDate + BeatTime.UTCplus1Offset + seconds
let secondsSinceRefDate = someDateTime.timeIntervalSinceReferenceDate + seconds
/*
print("Start Date: \(someDateTime)")
print("Date converted: \(Date(timeIntervalSinceReferenceDate: secondsSinceRefDate))")
Expand Down

0 comments on commit 99975c7

Please sign in to comment.