Should the timezone in general settings effect the output of $time = date("g:ia");?
Yes, Craft calls date_default_timezone_set('UTC'); when initializing, so PHP will output all times in UTC by default.

If you want to output a time using the timezone that Craft has been set to in General Settings, you can do that with a DateTime object.

$now = new DateTime();
$time = $now-&gt;format('g:i a');