title: Getting date from string with HH:mm time format is not working for Japanese language and region in swift
body: <p>I am trying to get date from string using DateFormatter(). My phone is set to Japan region, Language to Japanese and time to 12 hour format. My app is set to 24 hour format so that user can select time from custom picker in 24 hour format. The Date string is "11 3月, 2019 15:35". The date formatter is "MMM dd, yyyy HH:mm". But it is not working and returns nil always. </p>
  
  <p>According to <a href="https://stackoverflow.com/questions/40581850/ios-10-bug-nsdate-hour-description-with-japan-region-and-24-hour-time-off">iOS 10 bug? NSDate hour description with Japan region and 24-Hour Time off</a>
  If i use "MMM dd, yyyy KK:mm" as date format then it works only if the time in string is bellow 12:00. Here is my code below.</p>
  
  <pre><code>static func dateFrom(string: String, timeString: String) -&gt; Date? {
  
      let dateFormatter = DateFormatter()
      dateFormatter.timeStyle = DateFormatter.Style.short
      dateFormatter.timeZone = NSTimeZone.local
      dateFormatter.locale = NSLocale.current
  
      /// Check time format
      var timeFormat = "KK:mm"
      if timeString.containsIgnoringCase(find: AppConstants.am.localizedStringWith()) || timeString.containsIgnoringCase(find: AppConstants.pm.localizedStringWith()) {
          timeFormat =  "h:mm a"
      }
      /// Check date for MMDD format
      dateFormatter.dateFormat = "MMM dd, yyyy \(timeFormat)"
      if let date = dateFormatter.date(from: string) {
          return date
      }
      /// Check date for DDMM format
      dateFormatter.dateFormat = "dd MMM, yyyy \(timeFormat)"
      if let date = dateFormatter.date(from: string) {
          return date
      }
  
      return dateFormatter.date(from: string)
  }
  </code></pre>
  
  <p>Please let me know if you found solution for it.</p>