iwato Posted June 20, 2010 Share Posted June 20, 2010 QUESTION: Why am I told -- after just setting the variable type of $tz_CET to an integer -- that an unexpected T_STRING is encountered in the statement that reads: $tz_CET = $tz_CET + (60 + 60); if (date_default_timezone_set("Europe/Berlin")) { $tz_CET = date("Z"); settype($tz_CET, "integer"); if (date("I")) { $tz_CET = $tz_CET + (60 x 60); echo "Daylight savings time is in effect for " . date_default_timezone_get() . ".<br />"; } } else { echo "Timezone reset unsuccessful."; } Roddy Link to comment Share on other sites More sharing options...
Synook Posted June 20, 2010 Share Posted June 20, 2010 I see an "x", not a "+": $tz_CET = $tz_CET + (60 x 60); The multiplication operator is the asterisk, "*".P.S. the error has nothing to do with the typecasting. Link to comment Share on other sites More sharing options...
iwato Posted June 20, 2010 Author Share Posted June 20, 2010 The multiplication operator is the asterisk, "*".You can tell I am still a beginner.Everything works fine now.Thanks, Synook, for the correction.Roddy Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.