My final working code. You will see why I wanted a PHP one-liner for this:



Code:
				// Use SongKick's fucked up DateTime field, which is NOT GMT time but rather the local concert time followed by a UTC OFFSET value.
				$datetime = $fullShowDetail->start["datetime"];
				
				// Fail out if there isn't a show time at all.
				if ("" == $datetime) 
				{
					if ($debugprints==true) { echo("No datetime found in show information. Fill out your event times! Failing out of program.<br>"); }
					die(" ");
				}
				
				// Obtain the timezone offset number out of the datetime string.
				// Datetime string will resemble this, with the offset baked in at the end (always 4 digits, always with a + or -, even if the number is 0000):
				//          2016-11-05T16:00:00-0400
				// TODO: Find out if there is a PHP one-liner that does all this crap below without me having to do the bullshit parsing.
				// I tried to find one but they all gave me the local server's timezone offset rather than the offset baked into the sting.
				$timezoneOffsetString = substr($datetime, -5);
				// (Last 5 characters of string are the sign and the time offset in HHMM format such as -0400 or +1200 or +0000)

				// Make sure we actually got 5 characters
				if ( 5 != strlen($timezoneOffsetString) )
				{
					if ($debugprints==true) { echo("Problem parsing timezone offset out of DateTime string. Length of string was not 5. Failing out of program.<br>"); }
					die(" ");
				}
				
				// Get the sign character of the offset and validate it.
				$timezoneOffsetSign = substr($timezoneOffsetString, 0, 1);
				if ($timezoneOffsetSign != "-" and $timezoneOffsetSign != "+")
				{
					if ($debugprints==true) { echo("Problem parsing timezone offset out of DateTime string. Couldn't find plus or minus sign. Failing out of program.<br>"); }
					die(" ");
				}
				
				//Validate each of the digits to make sure it's the kind of string we want (last 4 characters of the offset string must all be digits)
				if (false==ctype_digit(substr($timezoneOffsetString, -4)))
				{
					if ($debugprints==true) { echo("Problem parsing timezone offset out of DateTime string. Offset string was not all digits. Failing out of program.<br>"); }
					die(" ");
				}

				// Now we know for sure we have a string such as "-0400" or "+1200" or "-0130" or "+0000" and we need to convert it into SECONDS.
				$timezoneOffsetSeconds = 0; // start with 0
				$timezoneOffsetSeconds +=  (int)substr($timezoneOffsetString, 1, 2) * 60 * 60;  // Hours is digit pos 1,2 times 60 minutes times 60 seconds.
				$timezoneOffsetSeconds +=  (int)substr($timezoneOffsetString, 3, 2) * 60 ;  // minutes is digit pos 3,4 times times 60 seconds.
			
				// Now if the sign was positive then flip the seconds to negative.
				// For instance an offset of -0400 means that we need to ADD 4 hours to our time to get back to a GMT number
				// whereas with an offset of +0400 means that we need to SUBTRACT 4 hours to our time to get back to a GMT number
				if ($timezoneOffsetSign == "+") { $timezoneOffsetSeconds = 0 - $timezoneOffsetSeconds; }
				



(Some time later...)

Code:

				// Peel the time offset off the datetime which was screwing up the strtotime function
				$strippedDatetime = substr($datetime, 0, strlen($datetime) - 5);
					
				// Use GMT time by calculating my own offset based on the offset value in the SongKick string
				$ics_file_contents .= "DTSTART:" . strftime("%Y%m%dT%H%M%SZ", $timezoneOffsetSeconds + strtotime($strippedDatetime)  ) . "\r\n";
								
				// DTEND is the time and date stampe for the end of the event.
				// Since SongKick doesn't have a show length, just add three hours to the existing
				// timestamp for the length. Since strtotime is in epoch-seconds, three hours is
				// 10800 seconds (60*60=3600 seconds in an hour, 3600*3 hours is 10800 seconds.)
				$ics_file_contents .= "DTEND:" . strftime("%Y%m%dT%H%M%SZ", $timezoneOffsetSeconds + 10800 + strtotime($strippedDatetime) ) . "\r\n";
	
_________________________
Tony Fabris