-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from dwyl/converting-to-json
we are converting the project details from JSON to a String (format found in #85)
- Loading branch information
Showing
5 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// dateConverter.swift | ||
// dwyl | ||
// | ||
// Created by Sohil Pandya on 22/06/2017. | ||
// Copyright © 2017 dwyl. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
func dateToString(date: Date) -> String { | ||
let formatter = DateFormatter() | ||
formatter.dateFormat = "yyyy-MM-dd hh:mm:ss" | ||
return formatter.string(from: date) | ||
} | ||
|
||
func stringToDate(string: String) -> Date { | ||
let formatter = DateFormatter() | ||
formatter.dateFormat = "yyyy-MM-dd hh:mm:ss" | ||
return formatter.date(from: string)! | ||
} |