0
Welcome Guest! Login
0 items Join Now

Display date in spanish

  • Display date in spanish

    Posted 14 years 1 month ago
    • Hello, I tried for more then 48 hours to solved a display problem for my date. I am using the TerranTribune template. I added a setLocale to display my date in spanish but no success.

      I then went to the folder js and manually changed the rokutils.js and replace the days and months for spanish. That worked. But what happens if I want to install a new language ? My dates will be in spanish. There is no way to display the correct date for the correct language by code ?

      Thanks for the help !

      //make the language ES
      setlocale (LC_TIME, "es_ES");
      // echo strftime ('%A %d %B %Y');
      $now = &JFactory::getDate();

      //$now = strftime ('%A %d %B %Y');
      echo $now->toFormat('%A'); ?>
      <span class="date-number"><?php echo $now->toFormat('%d'); ?></span>
      <?php echo $now->toFormat('%B'); ?>
      </div>

Time to create page: 0.048 seconds