Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

swift stirng to date

let isoDate = "2016-04-14T10:44:00+0000"

let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSIX") // set locale to reliable US_POSIX
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
let date = dateFormatter.date(from:isoDate)!

let calendar = Calendar.current
let components = calendar.dateComponents([.year, .month, .day, .hour], from: date)

let finalDate = calendar.date(from:components)
Comment

PREVIOUS NEXT
Code Example
Swift :: swift generate uuid 
Swift :: how to get index path cell collection view from ui longpress gesture swift 
Swift :: uistackview insets 
Swift :: Check if device is iPhone or not swift ios 
Swift :: ui alert swift yes no 
Swift :: convert string to int swift 
Swift :: how to disable uitableview selection in swift 
Swift :: add toggle without text swiftui 
Swift :: swift compare string to button title 
Swift :: how to add social media icons in swiftui 
Swift :: swift uiswitch change size 
Swift :: swift set uiimage color 
Swift :: UICollectionView current visible cell index 
Swift :: swiftui list navigation link 
Swift :: swift remove tableview cell 
Swift :: swift thread.sleep 
Swift :: swift round double to 2 decimal places 
Swift :: clone repo using jenkins pipeline 
Swift :: swift print 
Swift :: swift add programmatically constraint to view 
Swift :: uibutton swift set title color 
Swift :: swift5 get uiview height 
Swift :: remove key by index dictionary swift 
Swift :: how to dismiss a view when touch up inside swift 
Swift :: How to convert String into Array of character 
Swift :: sort list ios swift 
Swift :: swifter apply progress bar 
Swift :: swift session.input 
Swift :: Swift static Methods 
Swift :: swift - salesforce chat only 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =