-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_contest_offset.php
More file actions
27 lines (25 loc) · 1.08 KB
/
start_contest_offset.php
File metadata and controls
27 lines (25 loc) · 1.08 KB
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
<?php
// echo "default time = ".date_default_timezone_get();
$str=$key->start;//utc format
//echo $str."<br>";
// hour and min convert to integer
$HrMin= $start_contest->format('H:i:s');
//echo $HrMin."<br>";
//store hr and min in integer
$HrMin_integer=strtotime($HrMin);
//echo "type define = ".$HrMin_integer."<br>";
//add time to integer
$India_time_offset=$offset;
$add_sec=$HrMin_integer + $India_time_offset;
//echo "add second in hr & min = ".$add_sec."<br>";
//convert back to its original format
// echo "converted date and time = ".date("H:i:s", $add_sec)."<br>";
//if hour is greater than 24 hr. then change in day value format
$date_store=date("h:i a", $add_sec);
$start_contest_format = $start_contest->format('d.m.Y');
echo $start_contest_format." ".$date_store;
//echo $date_store."<br>";
// //hour check
// $Hr_check=date("d:H", $add_sec);
// echo $Hr_check."<br>";
?>