Diff
checker
Testo
Testo
Immagini
Documenti
Excel
Cartelle
Legal
Enterprise
Applicazione per desktop
Prezzi
Accedi
Scarica Diffchecker Desktop
Confronta il testo
Trova la differenza tra due file di testo
Strumenti
Cronologia
Editor live
Comprimi invariate
Senza a capo
Layout
Diviso
Unificato
Livello di dettaglio
Intelligente
Parola
Carattere
Evidenziazione sintassi
Scegli sintassi
Ignora
Trasforma testo
Vai alla prima modifica
Modifica input
Diffchecker Desktop
Il modo più sicuro per usare Diffchecker. Ottieni l'app Diffchecker Desktop: i tuoi diff non lasciano mai il tuo computer!
Ottieni Desktop
Untitled diff
Creato
11 anni fa
Il diff non scade mai
Eliminare
Esporta
Condividere
Spiegare
15 rimozioni
Linee
Totale
Rimosso
Caratteri
Totale
Rimosso
Per continuare a utilizzare questa funzione, aggiorna a
Diff
checker
Pro
Visualizza prezzi
58 linee
Copia tutti
21 aggiunte
Linee
Totale
Aggiunto
Caratteri
Totale
Aggiunto
Per continuare a utilizzare questa funzione, aggiorna a
Diff
checker
Pro
Visualizza prezzi
63 linee
Copia tutti
<?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
Copia
Copiato
Copia
Copiato
$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) {
Copia
Copiato
Copia
Copiato
$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 {
Copia
Copiato
Copia
Copiato
echo "You entered:
" . $queryTime . "<hr style='display:block;'>";
echo "You entered:
" . $queryTime . "<hr style='display:block;'>";
exit;
exit;
}
}
$timezones = array(
$timezones = array(
Copia
Copiato
Copia
Copiato
'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'
,
);
);
Copia
Copiato
Copia
Copiato
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) {
Copia
Copiato
Copia
Copiato
$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/>";
}
}
?>
?>
Diff salvati
Testo originale
Apri 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/>"; } ?>
Testo modificato
Apri 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/>"; } ?>
Trovare la differenza