Mercurial > public > lazybear
comparison LazyBear/Global functions/ConvertEpoch.swift @ 457:c6913f0ce46e
Minor UI Updates
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Mon, 28 Jun 2021 14:03:50 +0200 |
parents | b560babcd5ed |
children |
comparison
equal
deleted
inserted
replaced
456:d576b2b59014 | 457:c6913f0ce46e |
---|---|
8 import SwiftUI | 8 import SwiftUI |
9 | 9 |
10 /* | 10 /* |
11 Convert Epoch time (in miliseconds) to human readable date | 11 Convert Epoch time (in miliseconds) to human readable date |
12 */ | 12 */ |
13 func convertEpoch(_ miliseconds: Int, _ interval: Bool) -> String { | 13 func convertEpoch(_ miliseconds: Int64, _ interval: Bool) -> String { |
14 let now = Date() // Current date | 14 let now = Date() // Current date |
15 | 15 |
16 // TimeInterval() function must be in seconds, not in miliseconds | 16 // TimeInterval() function must be in seconds, not in miliseconds |
17 let convertedDate = Date(timeIntervalSince1970: TimeInterval(miliseconds/1000)) | 17 let convertedDate = Date(timeIntervalSince1970: TimeInterval(miliseconds/1000)) |
18 | 18 |