code.fastix.org

Dateiansicht:

Datei:Projekte -> PHP:internationalisierte Zeitangaben ohne strftime oder Intl-Extension -> test.php
md5:f6e5fee394a00f66586fb08191f607a1
sha1:8816f7c11ac5f25e4381525e6b14e25fa8aa8e02
Download-Link:Download
  1. <?php
  2.  
  3. error_reporting( E_ALL );
  4. ini_set('display_errors', 1);
  5.  
  6. require_once( 'timestrings.class.php' );
  7.    
  8. $timestrings=new timestrings();
  9. echo '"' . $timestrings->getWeekdayName(0). '"' . PHP_EOL;                           ##Sunday
  10. echo '"' . $timestrings->getWeekdayShortName(0). '"' . PHP_EOL;                      ##Sun
  11. echo '"' . $timestrings->getMonthName(12). '"' . PHP_EOL;                            ##December
  12. echo '"' . $timestrings->getMonthShortName(12). '"' . PHP_EOL;                       ##Dec
  13.  
  14.  
  15.  
  16. $timestrings->addLanguage ( 'de_DE.utf8' );
  17. echo '"' . $timestrings->getWeekdayName(0). '"' . PHP_EOL;                           ##Sonntag
  18. echo '"' . $timestrings->getWeekdayShortName(0). '"' . PHP_EOL;                      ##Son
  19. echo '"' . $timestrings->getMonthName(12). '"' . PHP_EOL;                            ##Dezember
  20. echo '"' . $timestrings->getMonthShortName(12). '"' . PHP_EOL;                       ##Dez
  21.  
  22. echo '"' . $timestrings->getWeekdayName(0, 'it_IT.utf-8'). '"' . PHP_EOL;            ##domenica
  23. echo '"' . $timestrings->getWeekdayShortName(0, 'it_IT.utf-8'). '"' . PHP_EOL;       ##dom
  24. echo '"' . $timestrings->getMonthName(12, 'it_IT.utf-8'). '"' . PHP_EOL;             ##dicembre
  25. echo '"' . $timestrings->getMonthShortName(12, 'it_IT.utf-8'). '"' . PHP_EOL;        ##diz
  26.  
  27. echo '"' . $timestrings->getWeekdayName(0, 'en_US'). '"' . PHP_EOL;                  ##Sunday
  28. echo '"' . $timestrings->getWeekdayShortName(0). '"' . PHP_EOL;                      ##Sun
  29. echo '"' . $timestrings->getMonthName(12). '"' . PHP_EOL;                            ##December
  30. echo '"' . $timestrings->getMonthShortName(12). '"' . PHP_EOL;                       ##Dec
  31.