title: Date Time function in Dialogflow fulfillment
body: <p>Can anyone explain what does these function means?</p>
  
  <pre><code>setDate = agent.parameters.date.split('T')[0];
  setTime = agent.parameters.time.split('T')[1].split(':')[0];
  </code></pre>
  
  <p>I am doing a booking for reservation and I want Google Assistant to print out the timing user enter as a 12-hour Format. Right now, when I key in 4pm, it will print out at 16. My date it working perfectly, but the time is not. I've tried other methods, but I don't really understand that the "split" means. </p>
  
  <p>eg. If I say <strong><em>"book table today 4.30pm"</em></strong>, then google will reply as <strong><em>"You have booked on 2018-11-23 at 4:30PM."</em></strong> But with the codes now, it prints out <strong><em>" 2018-11-23 at 16"</em></strong></p>
  
  <p>This is my code:</p>
  
  <pre><code>function makeBooking(agent){
  
  bookingDate= agent.parameters.date.split('T')[0];
  bookingTime = agent.parameters.time.split('T')[1].split(':')[0];
  
  agent.add(`You have booked on ${availDate} at ${availTime}.`);
  
  }
  
  // A helper function that receives Dialogflow's 'date' and 'time' parameters and creates a Date instance.
  
  function convertParametersDate(date, time){
    var resultDate = new Date(Date.parse(date.split('T')[0]));
    return resultDate;
  }
  </code></pre>