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! | Hold your calendar on January 30, 2008 for this free webcast on the new i5/OS. Rational's Enterprise Modernization products will be discussed at this webcast as they help to drive the application development environment for this new System i OS. <br />And learn how i5/OS will take you to the next step of efficient, resilient business processing. You will hear about the new i5/OS capabilities as it will be the most significant i5/OS release in years. If you cannot join the webcast on 1/30/08 you can still use this link to listen to the replay.<br /> FREE! Go There Now!
| | | | Achieving true agility is a never-ending effort. We will showcase how you can become agile incrementally, a few practices at the time.Which practices should any agile team strive to adopt? What additional practices should you consider based on your needs to scale? Adopting practices are however made much easier with the right tool support. What about if your tools adapt to your practices? We will take a look at how the Jazz technology can be leveraged to make your process change the behavior of your tools. FREE! Go There Now!
| | | | In this tutorial, you can learn how to install and configure the IBM Rational Asset Manager Eclipse client, explore the different views in the Asset Management perspective, learn various search techniques, work with existing assets, and submit a new asset. FREE! Go There Now!
| | | | This tutorial shows new users of IBM WebSphere Business Monitor Version 6.0.2 how to perform the "Hello World" equivalent for monitoring business process applications. It is intended to help you get familiar with the capabilities of the product. FREE! Go There Now!
| | | | Asset Reuse is a key strategy for companies looking to create innovative solutions to solve complex software development problems. Searching for, identifying, updating, using and deploying software assets can be a difficult challenge. Listen to this webcast, to learn about strategies and tools that you can leverage for a successful project, including Rational Asset Manager, Rational Software Architect and WebSphere Service Registry and Repository. FREE! Go There Now!
| | | | XML has become a common way of storing business data as flat files and many data server vendors including IBM have provided ways to store this data within relational database systems. Increasingly collections of XML files are accessed like databases using an xQuery and other XML standard mechanisms. Businesses find the need to combine the traditional tabular structured data with XML formatted data. In this webcast, you’ll learn about IBM’s WebSphere Federation Server technology, which provides users with the ability to integrate these two data formats. FREE! Go There Now!
| | | | Ken Krugler, co-founder of code search company Krugle, and Laura Merling, vice president of Marketing and Business Development for Krugle, join to talk about the ins and outs of code search and what it means as a new feature for developerWorks users. FREE! Go There Now!
| | | | Get a free trial download of IBM Lotus Forms V3.0 (formerly Workplace Forms), which provides a zero-footprint eForms solution to help you automate and move forms-based business processes off the desktop and onto the Web. With Lotus Forms, you can extend applications beyond the firewall by creating a single electronic form document ready for use in both thick and Web 2.0 thin client format. FREE! Go There Now!
| | | | Get a free trial download of the latest version of IBM Rational Performance Tester V7.0.1, a load and performance testing solution for teams concerned about the scalability of their Web-based applications. Combining multiple ease-of-use features with granular detail, Rational Performance Tester simplifies the test-creation, load-generation and data-collection processes that help teams ensure the ability of their applications to accommodate required user loads. FREE! Go There Now!
| | | | The Eclipse community is constantly working to extend Eclipse's functionality. In this webcast, learn about some of the most important and feature-rich projects under development. From multi-language support to plug-in development, tune in to see what Eclipse is capable of now. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |