Mercurial > public > lazybear
diff LazyBear/Global functions/ConvertStringToDate.swift @ 411:681fb377235e
Implementing insider transactions
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Mon, 07 Jun 2021 20:59:52 +0200 |
parents | |
children | 5f21f7c23c5e |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Global functions/ConvertStringToDate.swift Mon Jun 07 20:59:52 2021 +0200 @@ -0,0 +1,18 @@ +// +// ConvertStringToDate.swift +// LazyBear +// +// Created by Dennis Concepción Martín on 7/6/21. +// + +import SwiftUI + +func convertStringToDate(_ stringDate: String) -> Date { + // Convert string to date + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd" + + let date = dateFormatter.date(from: stringDate)! + + return date +}