Date Time Code

  Home arrow Date Time Code arrow Date converter to your language
DATE TIME CODE

Date converter to your language
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2003-04-29

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    Very simple date converter.

    By : carrzco

    <?
    if (eregi("functions_date.php",$PHP_SELF)) { // If accessed directly,
    header("Location:../index2.php"); // Sends you to your index page (mine is outside my functions dir.)
    die();
    }
    ?>
    <?
    function conv_fecha($dia_larga) // this is the Day converter, mines does it to spanish
    {
    switch($dia_larga){
    case "Monday":
    $dia_larga="Lunes";
    return $dia_larga;
    break;
    case "Tuesday":
    $dia_larga="Martes";
    return $dia_larga;
    break;
    case "Wednesday":
    $dia_larga="Miercoles";
    return $dia_larga;
    break;
    case "Thursday":
    $dia_larga="Jueves";
    return $dia_larga;
    break;
    case "Friday":
    $dia_larga="Viernes";
    return $dia_larga;
    break;
    case "Saturday":
    $dia_larga="Sabado";
    return $dia_larga;
    break;
    case "Sunday":
    $dia_larga="Domingo";
    return $dia_larga;
    break;
    }}
    ?>
    <?
    function conv_mes($mes) // this is the Month converter, mines does it to spanish
    {
    switch($mes){
    case 1:
    $mes="Enero";
    return $mes;
    break;
    case 2:
    $mes="Febrero";
    return $mes;
    break;
    case 3:
    $mes="Marzo";
    return $mes;
    break;
    case 4:
    $mes="Abril";
    return $mes;
    break;
    case 5:
    $mes="Mayo";
    return$mes;
    break;
    case 6:
    $mes="Junio";
    return $mes;
    break;
    case 7:
    $mes="Julio";
    return $mes;
    break;
    case 8:
    $mes="Agosto";
    return $mes;
    break;
    case 9:
    $mes="Septiembre";
    return $mes;
    break;
    case 10:
    $mes="Octubre";
    return $mes;
    break;
    case 11:
    $mes="Noviembre";
    return $mes;
    break;
    case 12:
    $mes="Diciembre";
    return $mes;
    break;
    }}
    ?>
    <?
    $dia_larga= date("l");
    $dia=date("j");
    $mes=date("n");
    $year=date("Y");
    // SENDS THE DAY AND MONTH TO THE FUNCTIONS TO BE CONVERTED
    $dia_larga=conv_fecha($dia_larga);
    $mes=conv_mes($mes);
    ?>

    <? echo $dia_larga . " , " . $dia . " de " . $mes . " del año " . $year; ?>
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Date Time Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    DATE TIME CODE ARTICLES

    - DaysInSpan.php
    - MySQLdateSpan.php
    - DateSpan.php
    - FutureDateFormEntry.php
    - Generate Time Option List for Select stateme...
    - Current Age Script (v2)
    - class for some mysql imitated time functions
    - Current Age Script, up to the last day
    - filemtime_remote
    - Page Generation Time Figure-Outer
    - convGMT v2
    - Benchmarker
    - Simple PHP Calendar
    - Display message according to hour of day
    - Display Date Function

    Developer Shed Affiliates

     



    © 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap