phpでファイルの更新時刻からの経過時間を表示する例。

<html>
<head>
<title>ファイルの更新時刻からの経過時間を表示する</title>
</head>
<body>
<?php


$fileName = "test.php";
setlocale(LC_TIME, "ja");

if (file_exists($fileName)) {


    $string1 = strtotime(date("Y/m/d H:i:s", filemtime($fileName)));
    echo "<p>最終更新時刻:".date("Y/m/d H:i:s", $string1);


    $string2 = strtotime(date("Y/m/d H:i:s"));
    echo "<p>現在の時刻:".date("Y/m/d H:i:s", $string2);


    $string = ($string2 - $string1) / 60;
    echo "<p>現在の時刻との差は".$string."分です";

} else {

    echo "ファイルが見つかりません";

}

?>

14 Comments

  1. dich vu marketing says:

    … [Trackback]

    […] Read More on that Topic: dragon-ark.com/archives/433 […]

  2. eBay music sale says:

    … [Trackback]

    […] Find More Information here on that Topic: dragon-ark.com/archives/433 […]

  3. best CBD oil says:

    … [Trackback]

    […] Read More Info here on that Topic: dragon-ark.com/archives/433 […]

  4. exchange online plan 2 says:

    … [Trackback]

    […] Info on that Topic: dragon-ark.com/archives/433 […]

  5. hp sunucu servis says:

    … [Trackback]

    […] Information to that Topic: dragon-ark.com/archives/433 […]

  6. hackear whatsapp online says:

    … [Trackback]

    […] Read More Info here on that Topic: dragon-ark.com/archives/433 […]

  7. best cc dumps says:

    … [Trackback]

    […] Info on that Topic: dragon-ark.com/archives/433 […]

  8. Sunucu Teknik Destek says:

    … [Trackback]

    […] Information to that Topic: dragon-ark.com/archives/433 […]

  9. world market link says:

    … [Trackback]

    […] Read More on to that Topic: dragon-ark.com/archives/433 […]

  10. Windshield marketing ideas says:

    … [Trackback]

    […] Read More Info here on that Topic: dragon-ark.com/archives/433 […]

Leave a Reply