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 developerWorks - FREE Tools! | The IBM DB2 Deep Compression ROI tool is designed for DBA’s and IT management personnel to perform a clinical analysis of the cost savings gained from the Storage Optimization feature of DB2 9 for Linux, UNIX and Windows. The feature, also known as Deep Compression, compresses data that lies within a database by up to 80% at times. FREE! Go There Now!
| | | | Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, for an overview of Rational’s new software offerings and resources to help modernize and accelerate software innovation on i on Power Systems – while ensuring past application investments are protected and continue to grow. Learn how these solutions are helping customers extend their core i5/OS solutions toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time. FREE! Go There Now!
| | | | WebSphere Process Server delivers a unique integration framework that simplifies existing IT resources. Often, as IT assets grow to support business demand, so too does their complexity and manageability. In this webcast, we’ll discuss how WebSphere Process Server helps deliver an SOA infrastructure that provides a common model to orchestrate, mediate, connect, map, and execute the underlying IT functions. Discover how WebSphere Process Server simplifies integration of business processes by leveraging existing IT assets as reusable services without the complexities of traditional integration methodologies. FREE! Go There Now!
| | | | Download a free trial version of IBM DB2 9.5 for Linux, UNIX, and Windows. DB2 9 is the result of a five-year development project that transformed traditional (static) database technology into an interactive data server that merges the high performance and ease of use of DB2 with the self-describing benefits of XML. FREE! Go There Now!
| | | | Visit IBM developerWorks to download a free trial version of WebSphere Extended Deployment Compute Grid, which lets you schedule, execute, and monitor batch jobs. Because online transaction processing and batch jobs execute simultaneously on the same server resources, you can avoid costly duplication of resources. Compute Grid supports job types of Java transactional batch, compute-intensive and a new type called "native execution", which enables non-Java workloads to run on distributed end points. FREE! Go There Now!
| | | | This webcast outlines the best practices that must be instituted to gain the maximum benefit from SOA while maintaining high quality of service. Whether you are deploying new applications or managing and monitoring your existing infrastructure, learn how you can ensure high quality of services with SOA based solutions from IBM. All registrants who attend this live Web Seminar will receive complimentary access to a white paper titled “Maintaining QoS in an SOA Environment”. FREE! Go There Now!
| | | | Join this Rational Talks to You teleconference on December 11 at 1:00 pm ET to get tips on building your own plugins with Rational Method Composer. Get your questions answered! FREE! Go There Now!
| | | | Discover how Rational tools and best practices for testing can make your job easier. The new Rational Testing eKits provide you with valuable resources – including demos, webcasts, tutorials, and articles – that help you address your specific testing needs across the software lifecycle. Five new eKits are available covering the topics of Requirements and Test Management, Functional Testing, Performance Testing, Code Quality and Embedded Systems, and SOA and Web Services Testing. FREE! Go There Now!
| | | | This paper is about the critical role that a discipline called integrated requirements management can play in helping to ensure that your business goals and IT investments are continuously aligned—whether you are sourcing, integrating, building or maintaining software. It also looks at ways that automated IBM Rational® products can work together to help you use requirements in the very best way. FREE! Go There Now!
| | | | You can now evaluate IBM Rational Asset Manager V7.0 online without installing or configuring it on your own system! Rational Asset Manager helps create, modify, govern, find, and reuse any type of development assets, including SOA and systems development assets. Rational Asset Manager helps you reduce software development costs and improve quality by facilitating the reuse of all types of software development-related assets. Visit developerWorks to learn more about this product and register to explore its capabilities online. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |