Converting a date/time string to the right Zoho date/time format

Converting a date/time string to the right Zoho date/time format

I have a date/time string in the format of "2010-08-01T18:07:22-06:00".  I'm trying to convert it into a date/time variable in Zoho.  I'm using the .toTime() function on the string like this:
  1. datetime = datetimestring.toTime("yyyy-MM-ddTHH:mm:ss")
When I execute the script, it gives me an error that it's "unable to update variable datetime."  So there is an error in converting the string to a Zoho date/time.  I'm thinking it might have to do with the timezone on the end of the string (-06:00), which I can just throw out.

How might I format the .toTime() function to correctly convert the string to a valid date/time in Zoho?