Skip to content

Instantly share code, notes, and snippets.

@iltercengiz
Created March 10, 2015 16:18
Show Gist options
  • Save iltercengiz/13d13cb5b684762c8323 to your computer and use it in GitHub Desktop.
Save iltercengiz/13d13cb5b684762c8323 to your computer and use it in GitHub Desktop.
Date Fortmatter
import Foundation
import UIKit
let date = NSDate(timeIntervalSince1970:1426003200)
let dateFormatter = NSDateFormatter()
dateFormatter.dateStyle = .MediumStyle
dateFormatter.stringFromDate(date)
dateFormatter.dateFormat = "HH:mm, d MMM yyyy"
dateFormatter.stringFromDate(date)
dateFormatter.dateFormat = "HH:mm, d MMMM yyyy"
dateFormatter.stringFromDate(date)
dateFormatter.locale = NSLocale(localeIdentifier:"tr")
dateFormatter.stringFromDate(date)
dateFormatter.locale = NSLocale(localeIdentifier:"ru")
dateFormatter.stringFromDate(date)
dateFormatter.locale = NSLocale.currentLocale()
dateFormatter.stringFromDate(date)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment