+// corrects a time stamp to be the local time
+function getGMTSeconds($stamp, $gmt) {
+ global $invert_time;
+ if (($gmt == 'Pacific') || ($gmt == 'PST')) {
+ $gmt = '-0800';
+ } else if (($gmt == 'EDT')) {
+ $gmt = '-0400';
+ } else if (($gmt == 'Eastern') || ($gmt == 'EST') || ($gmt == 'CDT')) {
+ $gmt = '-0500';
+ } else if (($gmt == 'Central') || ($gmt == 'CST') || ($gmt == 'MDT')) {
+ $gmt = '-0600';
+ } else if (($gmt == 'Mountain') || ($gmt == 'MST') || ($gmt == 'PDT')) {
+ $gmt = '-0700';
+ } else if ($gmt == 'BST') {
+ $gmt = '+0100';
+ } else if ($gmt == 'EET') {
+ $gmt = '+0200';
+ } else if ($gmt == 'GMT') {
+ $gmt = '+0000';
+ } else if ($gmt == 'HKT') {
+ $gmt = '+0800';
+ } else if ($gmt == 'IST') {
+ $gmt = '+0200';
+ } else if ($gmt == 'JST') {
+ $gmt = '+0900';
+ } else if ($gmt == 'KST') {
+ $gmt = "+0900";
+ } else if ($gmt == 'MET') {
+ $gmt = '+0100';
+ } else if ($gmt == 'MET DST' || $gmt == 'METDST') {
+ $gmt = '+0200';
+ }
+
+ if (substr($gmt, 0, 1) == '-') {
+ $neg = true;
+ $gmt = substr($gmt, 1, strlen($gmt));
+ } else if (substr($gmt, 0, 1) == '+') {
+ $neg = false;
+ $gmt = substr($gmt, 1, strlen($gmt));
+ } else {
+ $neg = false;
+ }
+
+ $gmt = substr($gmt, 0, 2);
+ $gmt = $gmt * 3600;
+ if ($neg == true) {
+ $gmt = "-$gmt";
+ } else {
+ $gmt = "+$gmt";
+ }
+
+ /** now find what the server is at **/
+ $current = date('Z', time());
+ if ($invert_time) {
+ $current = - $current;
+ }
+ $stamp = (int)$stamp - (int)$gmt + (int)$current;
+
+ return $stamp;
+}