type string datetime code example
Example 1: convert string date to datetime and format
var dateString = "2020-09-25T10:13:21.246321+01:00";
String formattedDateString = DateFormat('do LLLL yyyy').format(DateTime.parse(dateString));
// formattedDateString - OUTPUT: "25 September 2020"
Example 2: Datetime to utc format
string foo = yourDateTime.ToUniversalTime()
.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'");