Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php]Przetwarzanie daty
demoniczny
post 9.08.2011, 20:23:06
Post #1





Grupa: Zarejestrowani
Postów: 38
Pomógł: 0
Dołączył: 18.07.2011

Ostrzeżenie: (0%)
-----


  1.  
  2. function polishDate($date)
  3. {
  4. $date = explode("-", $date);
  5. $month = array(
  6. "1" => "Styczen",
  7. "2" => "Luty",
  8. "3" => "Marzec",
  9. "4" => "Kwiecien",
  10. "5" => "Maj",
  11. "6" => "Czerwiec",
  12. "7" => "Lipiec",
  13. "8" => "Sierpien",
  14. "9" => "Wrzesien",
  15. "10" => "Pazdziernik",
  16. "11" => "Listopad",
  17. "12" => "Grudzien",
  18. );
  19. $days = array(
  20. "Monday" => "Poniedzialek",
  21. "Tuesday" => "Wtorek",
  22. "Wednesday" => "Sroda",
  23. "Thursday" => "Czwartek",
  24. "Friday" => "Piatek",
  25. "Saturday" => "Sobota",
  26. "Sunday" => "Niedziela",
  27. );
  28. echo $month[$date[1]];
  29.  
  30. }


Mam funkcję do przetwarzania daty na polską lecz nie wiem jak zrobić z dniami aby wyświetlało polskiego odpowiednika
Będą to daty typu Poniedziałek Listopad 1992
Go to the top of the page
+Quote Post
Crozin
post 9.08.2011, 20:35:25
Post #2





Grupa: Zarejestrowani
Postów: 6 476
Pomógł: 1306
Dołączył: 6.08.2006
Skąd: Kraków

Ostrzeżenie: (0%)
-----


Nie kombinuj - http://pl.php.net/manual/en/book.intl.php
Go to the top of the page
+Quote Post
demoniczny
post 9.08.2011, 20:45:34
Post #3





Grupa: Zarejestrowani
Postów: 38
Pomógł: 0
Dołączył: 18.07.2011

Ostrzeżenie: (0%)
-----


Kurde nie znam za dobrze angielskiego a manual jest po angielsku ;/

które może być właściwe?
  1. IntlDateFormatter — The IntlDateFormatter class
  2. IntlDateFormatter::create — Create a date formatter
  3. IntlDateFormatter::format — Format the date/time value as a string
  4. IntlDateFormatter::getCalendar — Get the calendar used for the IntlDateFormatter
  5. IntlDateFormatter::getDateType — Get the datetype used for the IntlDateFormatter
  6. IntlDateFormatter::getErrorCode — Get the error code from last operation
  7. IntlDateFormatter::getErrorMessage — Get the error text from the last operation.
  8. IntlDateFormatter::getLocale — Get the locale used by formatter
  9. IntlDateFormatter::getPattern — Get the pattern used for the IntlDateFormatter
  10. IntlDateFormatter::getTimeType — Get the timetype used for the IntlDateFormatter
  11. IntlDateFormatter::getTimeZoneId — Get the timezone-id used for the IntlDateFormatter
  12. IntlDateFormatter::isLenient — Get the lenient used for the IntlDateFormatter
  13. IntlDateFormatter::localtime — Parse string to a field-based time value
  14. IntlDateFormatter::parse — Parse string to a timestamp value
  15. IntlDateFormatter::setCalendar — sets the calendar used to the appropriate calendar, which must be
  16. IntlDateFormatter::setLenient — Set the leniency of the parser
  17. IntlDateFormatter::setPattern — Set the pattern used for the IntlDateFormatter
  18. IntlDateFormatter::setTimeZoneId — Sets the time zone to use


Ten post edytował demoniczny 9.08.2011, 20:46:08
Go to the top of the page
+Quote Post
skowron-line
post 9.08.2011, 21:01:01
Post #4





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

Ostrzeżenie: (0%)
-----


@demoniczny czy ty przypadkiem nie przesadzasz questionmark.gif
http://translate.google.pl/


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 29.06.2025 - 02:34