Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Untitled diff
Created
11 years ago
Diff never expires
Clear
Export
Share
Explain
15 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
58 lines
Copy
21 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
63 lines
Copy
<?php
<?php
$timezones = array(
$timezones = array(
'EST' => -5*3600, //equador
'EST' => -5*3600, //equador
'UTC' => 0, //london
'UTC' => 0, //london
'CCT' => +8*3600, //beijing
'CCT' => +8*3600, //beijing
'PST' => -8*3600, //los angeles
'PST' => -8*3600, //los angeles
);
);
foreach ($timezones as $time) {
foreach ($timezones as $time) {
$now = time();
$now = time();
$now += $time;
$now += $time;
print gmstrftime('DATE: %B %d %Y and TIME: %r <br/>',$now);
print gmstrftime('DATE: %B %d %Y and TIME: %r <br/>',$now);
}
}
$nowM = date('m');
$nowM = date('m');
$nowD = date('d');
$nowD = date('d');
$nowY = date('Y');
$nowY = date('Y');
$nowHr = date('h');
$nowHr = date('h');
$nowMin = date('i');
$nowMin = date('i');
$nowSec = date('s');
$nowSec = date('s');
?>
?>
<form action="homework2.php" method="post">
<form action="homework2.php" method="post">
<label>Sync Timecode</label>
<label>Sync Timecode</label>
<input type="text" name="month" placeholder="Month <?php $nowM ?>" value="<?php $nowM ?>" />
<input type="text" name="month" placeholder="Month <?php $nowM ?>" value="<?php $nowM ?>" />
<input type="text" name="day" placeholder="Day <?php $nowD ?>" value="<?php $nowD ?>" />
<input type="text" name="day" placeholder="Day <?php $nowD ?>" value="<?php $nowD ?>" />
<input type="text" name="year" placeholder="Year <?php $nowY ?>" value="<?php $nowY ?>" />
<input type="text" name="year" placeholder="Year <?php $nowY ?>" value="<?php $nowY ?>" />
<input type="text" name="hour" placeholder="Hours <?php $nowHr ?>" value="<?php $nowHr ?>" />
<input type="text" name="hour" placeholder="Hours <?php $nowHr ?>" value="<?php $nowHr ?>" />
<input type="text" name="min" placeholder="Minutes <?php $nowMin ?>" value="<?php $nowMin ?>"/>
<input type="text" name="min" placeholder="Minutes <?php $nowMin ?>" value="<?php $nowMin ?>"/>
<input type="text" name="sec" placeholder="Seconds<?php $nowSec ?>" value="<?php $nowSec ?>"/>
<input type="text" name="sec" placeholder="Seconds<?php $nowSec ?>" value="<?php $nowSec ?>"/>
<input type="submit" id="button">
<input type="submit" id="button">
</form>
</form>
<?php
<?php
Copy
Copied
Copy
Copied
$format = 'd-m-Y
h
:i:s';
$format = 'd-m-Y
H
:i:s';
$queryTime = $_POST['day'] . "-" .
$_POST['month']
. "-" . $_POST['year'] . " " . $_POST['hour'] . ":" . $_POST['min'] . ":" . $_POST['sec'];
$queryTime = $_POST['day'] . "-" .
date('m',strtotime(
$_POST['month']
))
. "-" . $_POST['year'] . " " . $_POST['hour'] . ":" . $_POST['min'] . ":" . $_POST['sec'];
if (date($format,strtotime($queryTime)) == $queryTime) {
if (date($format,strtotime($queryTime)) == $queryTime) {
Copy
Copied
Copy
Copied
$now = new DateTime(
strtotime($queryTime)
, new DateTimeZone('America/Los_Angeles'));
try {
$now = new DateTime(
date("c",
strtotime($queryTime)
));
} catch (Exception $e) {
echo $e->getMessage();
exit(1);
}
} else {
} else {
Copy
Copied
Copy
Copied
echo "You entered:
" . $queryTime . "<hr style='display:block;'>";
echo "You entered:
" . $queryTime . "<hr style='display:block;'>";
exit;
exit;
}
}
$timezones = array(
$timezones = array(
Copy
Copied
Copy
Copied
'EST' =>
new DateTimeZone(
'America/Panama'
)
,
'EST' =>
'America/Panama'
,
'UTC' =>
new DateTimeZone(
'Europe/London'
)
,
'UTC' =>
'Europe/London'
,
'CCT' =>
new DateTimeZone(
'Asia/Hong_Kong'
)
,
'CCT' =>
'Asia/Hong_Kong'
,
'PST' =>
new DateTimeZone(
'America/Los_Angeles'
)
,
'PST' =>
'America/Los_Angeles'
,
);
);
Copy
Copied
Copy
Copied
echo "You entered:
" . $now->format($format) . "<hr style='display:block;'>";
echo "You entered:
" . $now->format($format) . "<hr style='display:block;'>";
foreach ($timezones as $zone) {
foreach ($timezones as $zone) {
Copy
Copied
Copy
Copied
$now = new DateTime
($now,
new DateT
ime
Z
one
($zone));
date_timezone_set
($now,
t
ime
z
one
_open
($zone));
print
"The time in
" . $zone . "
is
" . $now->format($format
) . "<br/>";
echo
"The time in
" . $zone . "
is
" . $now->format($format
." \G\M\TP"
) . "<br/>";
}
}
?>
?>
Saved diffs
Original text
Open file
<?php $timezones = array( 'EST' => -5*3600, //equador 'UTC' => 0, //london 'CCT' => +8*3600, //beijing 'PST' => -8*3600, //los angeles ); foreach ($timezones as $time) { $now = time(); $now += $time; print gmstrftime('DATE: %B %d %Y and TIME: %r <br/>',$now); } $nowM = date('m'); $nowD = date('d'); $nowY = date('Y'); $nowHr = date('h'); $nowMin = date('i'); $nowSec = date('s'); ?> <form action="homework2.php" method="post"> <label>Sync Timecode</label> <input type="text" name="month" placeholder="Month <?php $nowM ?>" value="<?php $nowM ?>" /> <input type="text" name="day" placeholder="Day <?php $nowD ?>" value="<?php $nowD ?>" /> <input type="text" name="year" placeholder="Year <?php $nowY ?>" value="<?php $nowY ?>" /> <input type="text" name="hour" placeholder="Hours <?php $nowHr ?>" value="<?php $nowHr ?>" /> <input type="text" name="min" placeholder="Minutes <?php $nowMin ?>" value="<?php $nowMin ?>"/> <input type="text" name="sec" placeholder="Seconds<?php $nowSec ?>" value="<?php $nowSec ?>"/> <input type="submit" id="button"> </form> <?php $format = 'd-m-Y h:i:s'; $queryTime = $_POST['day'] . "-" . $_POST['month'] . "-" . $_POST['year'] . " " . $_POST['hour'] . ":" . $_POST['min'] . ":" . $_POST['sec']; if (date($format,strtotime($queryTime)) == $queryTime) { $now = new DateTime(strtotime($queryTime), new DateTimeZone('America/Los_Angeles')); } else { echo "You entered:" . $queryTime . "<hr style='display:block;'>"; exit; } $timezones = array( 'EST' => new DateTimeZone('America/Panama'), 'UTC' => new DateTimeZone('Europe/London'), 'CCT' => new DateTimeZone('Asia/Hong_Kong'), 'PST' => new DateTimeZone('America/Los_Angeles'), ); echo "You entered:" . $now->format($format) . "<hr style='display:block;'>"; foreach ($timezones as $zone) { $now = new DateTime($now, new DateTimeZone($zone)); print "The time in" . $zone . "is" . $now->format($format) . "<br/>"; } ?>
Changed text
Open file
<?php $timezones = array( 'EST' => -5*3600, //equador 'UTC' => 0, //london 'CCT' => +8*3600, //beijing 'PST' => -8*3600, //los angeles ); foreach ($timezones as $time) { $now = time(); $now += $time; print gmstrftime('DATE: %B %d %Y and TIME: %r <br/>',$now); } $nowM = date('m'); $nowD = date('d'); $nowY = date('Y'); $nowHr = date('h'); $nowMin = date('i'); $nowSec = date('s'); ?> <form action="homework2.php" method="post"> <label>Sync Timecode</label> <input type="text" name="month" placeholder="Month <?php $nowM ?>" value="<?php $nowM ?>" /> <input type="text" name="day" placeholder="Day <?php $nowD ?>" value="<?php $nowD ?>" /> <input type="text" name="year" placeholder="Year <?php $nowY ?>" value="<?php $nowY ?>" /> <input type="text" name="hour" placeholder="Hours <?php $nowHr ?>" value="<?php $nowHr ?>" /> <input type="text" name="min" placeholder="Minutes <?php $nowMin ?>" value="<?php $nowMin ?>"/> <input type="text" name="sec" placeholder="Seconds<?php $nowSec ?>" value="<?php $nowSec ?>"/> <input type="submit" id="button"> </form> <?php $format = 'd-m-Y H:i:s'; $queryTime = $_POST['day'] . "-" . date('m',strtotime($_POST['month'])) . "-" . $_POST['year'] . " " . $_POST['hour'] . ":" . $_POST['min'] . ":" . $_POST['sec']; if (date($format,strtotime($queryTime)) == $queryTime) { try { $now = new DateTime(date("c",strtotime($queryTime))); } catch (Exception $e) { echo $e->getMessage(); exit(1); } } else { echo "You entered: " . $queryTime . "<hr style='display:block;'>"; exit; } $timezones = array( 'EST' => 'America/Panama', 'UTC' => 'Europe/London', 'CCT' => 'Asia/Hong_Kong', 'PST' => 'America/Los_Angeles', ); echo "You entered: " . $now->format($format) . "<hr style='display:block;'>"; foreach ($timezones as $zone) { date_timezone_set($now, timezone_open($zone)); echo "The time in " . $zone . " is " . $now->format($format." \G\M\TP") . "<br/>"; } ?>
Find difference