Time Php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Time Php

    i wnt time php code.plz anyone have dis.
    <div align="center">My Web Community ......... http://pahasara.net



    </div>

    #2
    // set the default timezone to use. Available since PHP 5.1
    date_default_timezone_set(&#39;UTC&#39;);


    // Prints something like: Monday
    echo date("l");

    // Prints something like: Monday 15th of August 2005 03:12:46 PM
    echo date(&#39;l dS \of F Y h:i:s A&#39;);

    // Prints: July 1, 2000 is on a Saturday
    echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));

    /* use the constants in the format parameter */
    // prints something like: Mon, 15 Aug 2005 15:12:46 UTC
    echo date(DATE_RFC822);

    // prints something like: 2000-07-01T00:00:00+00:00
    echo date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000));


    // Assuming today is: March 10th, 2001, 5:16:18 pm

    $today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm
    $today = date("m.d.y"); // 03.10.01
    $today = date("j, n, Y"); // 10, 3, 2001
    $today = date("Ymd"); // 20010310
    $today = date(&#39;h-i-s, j-m-y, it is w Day z &#39;); // 05-16-17, 10-03-01, 1631 1618 6 Fripm01
    $today = date(&#39;\i\t \i\s \t\h\e jS \d\a\y.&#39;); // It is the 10th day.
    $today = date("D M j G:i:s T Y"); // Sat Mar 10 15:16:08 MST 2001
    $today = date(&#39;H:m:s \m \i\s\ \m\o\n\t\h&#39;); // 17:03:17 m is month
    $today = date("H:i:s"); // 17:16:17
    http://ngeo.ro

    Comment


      #3
      hey thanks black.could i get date and time for funmobile.
      <div align="center">My Web Community ......... http://pahasara.net



      </div>

      Comment


        #4
        $t = date("H:i");
        echo $t; // 15:30
        same way for time or time+date.
        http://ngeo.ro

        Comment


          #5
          thnks black.
          <div align="center">My Web Community ......... http://pahasara.net



          </div>

          Comment


            #6
            thnks black. [/b]
            what about time for different countrys e.g some1 from england get uk time and some1 from france get france time but on same site

            Comment


              #7
              <?php

              // Get timestamp in server timezone
              $time = time();
              echo "Server time: " . date("d/m/Y H:i", $time) . "";

              // Get GMT timestamp
              $gm_time = $time - date(&#39;Z&#39;, $time);
              echo "GMT time: " . date("d/m/Y H:i", $gm_time) . "";

              // Difference:
              $diff = ($time - $gm_time)/3600;

              if ($diff < 0) {
              $timezone = &#39;GMT&#39; . $diff;
              } else {
              $timezone = &#39;GMT+&#39; . $diff;
              }

              echo &#39;Server timezone: &#39; . date(&#39;T&#39;, $time) . &#39;&#39;;
              echo &#39;Server timezone offset: &#39; . $timezone;

              ?>[/b]
              http://ngeo.ro

              Comment


                #8
                <?php

                $original_tz = getenv(&#39;TZ&#39;);
                $format = "d/m/Y H:i";

                // Server time:
                $server_time = time();
                echo &#39;Server time: &#39; . date($format, time()) . &#39;&#39;;

                // GMT time:
                $gm_time = $server_time - date(&#39;Z&#39;, $server_time);
                echo "GMT time: " . date($format, $gm_time) . "";

                // Africa/Cairo
                putenv(&#39;TZ=Africa/Cairo&#39;);
                $a_time = $gm_time + date(&#39;Z&#39;, time());
                putenv(&#39;TZ=&#39; . $original_tz);
                echo &#39;Africa/Cairo time: &#39; . date($format, $a_time) . "";

                // America/Los Angeles
                putenv(&#39;TZ=America/Los_Angeles&#39;);
                $a_time = $gm_time + date(&#39;Z&#39;, time());
                putenv(&#39;TZ=&#39; . $original_tz);
                echo &#39;America/Los Angeles: &#39; . date($format, $a_time) . "";

                // Europe/London
                putenv(&#39;TZ=Europe/London&#39;);
                $a_time = $gm_time + date(&#39;Z&#39;, time());
                putenv(&#39;TZ=&#39; . $original_tz);
                echo &#39;Europe/London: &#39; . date($format, $a_time) . "";

                putenv(&#39;TZ=&#39; . $original_tz);

                ?>[/b]


                where:
                Afrikaans = af
                Albanian = sq
                Arabic (Algeria) = ar-dz
                Arabic (Bahrain) = ar-bh
                Arabic (Egypt) = ar-eg
                Arabic (Iraq) = ar-iq
                Arabic (Jordan) = ar-jo
                Arabic (Kuwait) = ar-kw
                Arabic (Lebanon) = ar-lb
                Arabic (libya) = ar-ly
                Arabic (Morocco) = ar-ma
                Arabic (Oman) = ar-om
                Arabic (Qatar) = ar-qa
                Arabic (Saudi Arabia) = ar-sa
                Arabic (Syria) = ar-sy
                Arabic (Tunisia) = ar-tn
                Arabic (U.A.E.) = ar-ae
                Arabic (Yemen) = ar-ye
                Arabic = ar
                Armenian = hy
                Assamese = as
                Azeri (Cyrillic) = az
                Azeri (Latin) = az
                Basque = eu
                Belarusian = be
                Bengali = bn
                Bulgarian = bg
                Catalan = ca
                Chinese (China) = zh-cn
                Chinese (Hong Kong SAR) = zh-hk
                Chinese (Macau SAR) = zh-mo
                Chinese (Singapore) = zh-sg
                Chinese (Taiwan) = zh-tw
                Chinese = zh
                Croatian = hr
                Chech = cs
                Danish = da
                Divehi = div
                Dutch (Belgium) = nl-be
                Dutch (Netherlands) = nl
                English (Australia) = en-au
                English (Belize) = en-bz

                English (Canada) = en-ca
                English (Caribbean) = en
                English (Ireland) = en-ie
                English (Jamaica) = en-jm
                English (New Zealand) = en-nz
                English (Philippines) = en-ph
                English (South Africa) = en-za
                English (Trinidad) = en-tt
                English (United Kingdom) = en-gb
                English (United States) = en-us
                English (Zimbabwe) = en-zw
                English = en
                Estonian = et
                Faeroese = fo
                Farsi = fa
                Finnish = fi
                French (Belgium) = fr-be
                French (Canada) = fr-ca
                French (France) = fr
                French (Luxembourg) = fr-lu
                French (Monaco) = fr-mc
                French (Switzerland) = fr-ch
                FYRO Macedonian = mk
                Gaelic = gd
                Georgian = ka
                German (Austria) = de-at
                German (Germany) = de
                German (Liechtenstein) = de-li
                German (lexumbourg) = de-lu
                German (Switzerland) = de-ch
                Greek = el
                Gujarati = gu
                Hebrew = he
                Hindi = hi
                Hungarian = hu
                Icelandic = is
                Indonesian = id
                Italian (Italy) = it
                Italian (Switzerland) = it-ch
                Japanese = ja
                Kannada = kn
                Kazakh = kk
                Konkani = kok
                Korean = ko
                Kyrgyz = kz
                Latvian = lv
                Lithuanian = lt
                Malay (Brunei) = ms
                Malay (Malaysia) = ms
                Malayalam = ml
                Maltese = mt
                Marathi = mr
                Mongolian (Cyrillic) = mn
                Nepali (India) = ne
                Norwegian (Bokmal) = nb-no
                Norwegian (Bokmal) = no
                Norwegian (Nynorsk) = nn-no
                Oriya = or
                Polish = pl
                Portuguese (Brazil) = pt-br
                Portuguese (Portugal) = pt
                Punjabi = pa
                Rhaeto-Romanic = rm
                Romanian (Moldova) = ro-md
                Romanian = ro
                Russian (Moldova) = ru-md
                Russian = ru
                Sanskrit = sa
                Serbian (Cyrillic) = sr
                Serbian (Latin) = sr
                Slovak = sk
                Slovenian = ls
                Sorbian = sb
                Spanish (Argentina) = es-ar
                Spanish (Bolivia) = es-bo
                Spanish (Chile) = es-cl
                Spanish (Colombia) = es-co
                Spanish (Costa Rica) = es-cr
                Spanish (Dominican Republic) = es-do
                Spanish (Ecuador) = es-ec
                Spanish (El Salvador) = es-sv
                Spanish (Guatemala) = es-gt
                Spanish (Honduras) = es-hn
                Spanish (International Sort) = es
                Spanish (Mexico) = es-mx
                Spanish (Nicaragua) = es-ni
                Spanish (Panama) = es-pa
                Spanish (Paraguay) = es-py
                Spanish (Peru) = es-pe
                Spanish (Puerto Rico) = es-pr
                Spanish (Traditional Sort) = es
                Spanish (United States) = es-us
                Spanish (Uruguay) = es-uy
                Spanish (Venezuela) = es-ve
                Sutu = sx
                Swahili = sw
                Swedish (Finland) = sv-fi
                Swedish = sv
                Syriac = syr
                Tamil = ta
                Tatar = tt
                Telugu = te
                Thai = th
                Tsonga = ts
                Tswana = tn
                Turkish = tr
                Ukrainian = uk
                Urdu = ur
                Uzbek (Cyrillic) = uz
                Uzbek (Latin) = uz
                Vietnamese = vi
                Xhosa = xh
                Yiddish = yi
                Zulu = zu
                http://ngeo.ro

                Comment


                  #9
                  or use time settings by lang. (edit each lang)
                  <?
                  if(eregi(&#39;en-US&#39;, $HTTP_USER_AGENT)) {$thistime = date("H")+1;}
                  if(eregi(&#39;en-GB&#39;, $HTTP_USER_AGENT)) {$thistime = date("H")+8;}
                  else {$thistime = date("H");}
                  echo&#39;"&#39;.$thistime.&#39;" Is this close to your time?&#39;;
                  ?>
                  http://ngeo.ro

                  Comment


                    #10
                    Hi JayaShanka Below i given Time Php script. Create time.php page.
                    And Chmod to 755.
                    include this php script in your index page. any doubt pls contact to me on admin@teluguwap.com

                    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php

                    $TimeZone="0"; ////Change the TimeZone accordingly!
                    $New_Time = time() + ($TimeZone * 60 * 60);


                    $show_date=date("D d/m/Y",$New_Time);
                    $show_time=date("g:i:s a",$New_Time);
                    $Hour=date("G",$New_Time);

                    echo $show_date;
                    echo"
                    ";
                    echo $show_time;
                    echo"
                    ";


                    ////////////////Here you can change the messages, add lines with different hours etc. You could even display a different message every hour.////////////////

                    if ($Hour <= 4) { echo &#39;Hello night owl!&#39;; }

                    else if ($Hour <= 11) { echo &#39;Good morning!&#39;; }

                    else if ($Hour <= 12) { echo &#39;Enjoy your lunch!&#39;; }

                    else if ($Hour <= 17) { echo &#39;Good afternoon!&#39;; }

                    else if ($Hour <= 23) { echo &#39;Good Evening!&#39;; }

                    ?></div>

                    Comment


                      #11
                      time.php script is a easily available script here it is
                      Attached Files
                      get cheap web hosting ever AdzeHost
                      ===================
                      get free hosting for life time hostwebswap not allowed
                      ===================
                      get free cpanel web hosting free cpanel hostingwap are allowed
                      ===================

                      ===================

                      Comment

                      Working...
                      X