title: convert local Date time to UTC format
body: <p>i want to convert this 01/20/2021 20:10:14 to this format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'  in android.
  currently i am using function but when i convert to local format i don't get original time</p>
  <pre><code>fun convertDate (date : String) : String {
          var convertedDate = &quot;&quot;
          val calendar = Calendar.getInstance()
          val timeformat = SimpleDateFormat(&quot;HH:mm:ss&quot;)
          val time = timeformat.format(calendar.time)
          val formatter = SimpleDateFormat(&quot;MM/dd/yyyy HH:mm:ss&quot;)
          val odate = formatter.parse(date+&quot; &quot;+time)
          val utcformat = SimpleDateFormat(&quot;yyyy-MM-dd'T'HH:mm:ss.SSS'Z'&quot;)
          convertedDate = utcformat.format(odate)
          return convertedDate
      }
  </code></pre>