class func is24HourTimeFormat() -> Bool {
var dateFormatter = NSDateFormatter()
dateFormatter.dateStyle = NSDateFormatterStyle.NoStyle
dateFormatter.timeStyle = NSDateFormatterStyle.ShortStyle
dateFormatter.locale = (NSLocale.currentLocale())
var dateString = dateFormatter.stringFromDate(NSDate())
let amRange = dateString.rangeOfString(dateFormatter.AMSymbol)
let pmRange = dateString.rangeOfString(dateFormatter.PMSymbol)
return (amRange == nil && pmRange == nil)
}
沒有留言:
張貼留言