-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoffset_value.php
More file actions
37 lines (32 loc) · 873 Bytes
/
offset_value.php
File metadata and controls
37 lines (32 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
// get data information from list_of_timezone
if(isset($_POST['submit'])){
$zoneVal = $_POST['zoneVal'];
//echo "Your registration is: ".gettype($zoneVal);
///---------------offset value
$offset_value_get=0;
if($zoneVal[0]=='-'){
//$hrMin=ltrim($zoneVal, '-');
$hrMin = preg_replace("/[^0-9]/", "", $zoneVal);
$hrMin_int=(int)$hrMin;
$min=$hrMin%100;
$hr=($hrMin_int-$min)/100;
$offset_value=($hr*60+$min)*60;
//echo "-".$offset_value;
$strToint_offset="-".$offset_value;
$offset_value_get=(int)$strToint_offset;
echo $offset_value_get;
}
else if($zoneVal[0]=='+'){
$hrMin = preg_replace("/[^0-9]/", "", $zoneVal);
$hrMin_int=(int)$hrMin;
$min=$hrMin%100;
$hr=($hrMin_int-$min)/100;
$offset_value=($hr*60+$min)*60;
//echo $offset_value;
$strToint_offset=$offset_value;
$offset_value_get=(int)$strToint_offset;
echo $offset_value_get;
}
}
?>