Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
即時編輯器
摺疊未變更行
關閉換行
檢視
拆分
統一
比對精度
智能
單詞
字符
語法突出顯示
選擇語法
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
Untitled diff
建立於
11 年前
差異永不過期
清除
匯出
分享
解釋
15 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
58 行
全部複製
21 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
63 行
全部複製
<?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
複製
已複製
複製
已複製
$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) {
複製
已複製
複製
已複製
$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 {
複製
已複製
複製
已複製
echo "You entered:
" . $queryTime . "<hr style='display:block;'>";
echo "You entered:
" . $queryTime . "<hr style='display:block;'>";
exit;
exit;
}
}
$timezones = array(
$timezones = array(
複製
已複製
複製
已複製
'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'
,
);
);
複製
已複製
複製
已複製
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) {
複製
已複製
複製
已複製
$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/>";
}
}
?>
?>
已保存差異
原始文本
開啟檔案
<?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/>"; } ?>
更改後文本
開啟檔案
<?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/>"; } ?>
尋找差異