title: how to add calendar event on specific time and date?
body: <ul>
  <li>i get date and time from date-picker and i have set it <strong>into string</strong> format.</li>
  <li>i want to add event in given date and time.</li>
  <li>i want to set two alert, <strong>1</strong> alert on before given specific time like "5 minute, 15 minute, 30 minute". <strong>2</strong> second alert on event time.</li>
  <li>In below code what should i need to do for complete my requirement.</li>
  </ul>
  
  <p>give any suggestion or idea to solev it
  <strong>Thanks</strong></p>
  
  <p>get date and time from date-picker</p>
  
  <pre><code>let dateFormatter = DateFormatter()
  
      dateFormatter.dateFormat = "YYYY-MM-dd"
      routineDate = dateFormatter.string(from: self.datetimepicker.date)
      print(routineDate)
  
    let dateFormatter = DateFormatter()
  
      dateFormatter.dateFormat = "HH:mm a"
      routineTime = dateFormatter.string(from: self.datetimepicker.date)
      print(routineTime)
  </code></pre>
  
  <p>create and save EKEvent Here:</p>
  
  <pre><code> let dateFormatter = DateFormatter()
      dateFormatter.dateStyle = .short
      dateFormatter.dateFormat = "YYYY-MM-dd"
      let startDATE = dateFormatter.date(from: routineDate)
      let endDATE = dateFormatter.date(from: routineDate)
  
      print(routineDate)
      if temptypeID == "1" {
          let event:EKEvent = EKEvent(eventStore: appleEventStore)
          event.title = tempDescription
  
      //  what should i need to change here for specific date and time?
  
          event.startDate = (startDATE?.addingTimeInterval(60*60))!
          event.endDate = (endDATE?.addingTimeInterval(60*60))!
          event.isAllDay = false
          event.notes = "This is a note"
          event.calendar = cal
  
          do {
              try appleEventStore.save(event, span: .thisEvent)
              print("events added with dates:")
  
           // what should changes i need to do here for alert ?
  
              let alarm = EKAlarm(absoluteDate: Date(timeInterval: -3600, since: event.startDate))
  
          event.addAlarm(alarm)
  
          } catch let e as NSError {
              print(e.description)
              return
          }
          print("Saved Event")
      }
  </code></pre>