- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
public function getOwnTimeFromTime($_site_end_time , $timeSyncOk = false)
{
$_site_end_time_msk = strtotime($_site_end_time);
$_site_end = date('Y-m-d H:i:s', $_site_end_time_msk);
$iter = 0;
preg_match ("|(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)|usi",$_site_end_time, $_Time1);
do {
$date2 = mktime($_Time1[4], $_Time1[5], $_Time1[6], $_Time1[2], $_Time1[3], $_Time1[1]);
if ((($_site_end_time_msk - $date2) == 3*60*60) || (($_site_end_time_msk - $date2) == 4*60*60)) {
$timeSyncOk = true;
}
$iter++;
} while ($iter<=20 && $timeSyncOk==false);
if ($timeSyncOk==false) {
$_site_end = date("Y-m-d H:i:s", parseDatetime($_site_end_time));
}
return $_site_end;
}
Lure Of Chaos 18.10.2010 20:24 # +1
Uchkuma 19.10.2010 22:21 # 0
24 упоминания детектед.