Иногда нужно вывести дату и не просто день, месяц, год числами, а красиво с названиями дня недели и месяца и всё это на родном языке. Известно, что в языке PHP есть функция “date”, которая возвращает дату. Но естественно только на английском. Выглядит это примерно так: Thursday, 28 October 2010 г.
Выглядит как-то не очень.
Хотелось бы примерно так: Четверг, 28 Октября 2010 г.
Решение очень простое:
<?php
function russian_date() {
$translation = array(
"am" => "дп",
"pm" => "пп",
"AM" => "ДП",
"PM" => "ПП",
"Monday" => "Понедельник",
"Mon" => "Пн",
"Tuesday" => "Вторник",
"Tue" => "Вт",
"Wednesday" => "Среда",
"Wed" => "Ср",
"Thursday" => "Четверг",
"Thu" => "Чт",
"Friday" => "Пятница",
"Fri" => "Пт",
"Saturday" => "Суббота",
"Sat" => "Сб",
"Sunday" => "Воскресенье",
"Sun" => "Вс",
"January" => "Января",
"Jan" => "Янв",
"February" => "Февраля",
"Feb" => "Фев",
"March" => "Марта",
"Mar" => "Мар",
"April" => "Апреля",
"Apr" => "Апр",
"May" => "Мая",
"May" => "Мая",
"June" => "Июня",
"Jun" => "Июн",
"July" => "Июля",
"Jul" => "Июл",
"August" => "Августа",
"Aug" => "Авг",
"September" => "Сентября",
"Sep" => "Сен",
"October" => "Октября",
"Oct" => "Окт",
"November" => "Ноября",
"Nov" => "Ноя",
"December" => "Декабря",
"Dec" => "Дек",
"st" => "ое",
"nd" => "ое",
"rd" => "е",
"th" => "ое",
);
if (func_num_args() > 1) {
$timestamp = func_get_arg(1);
return strtr(date(func_get_arg(0), $timestamp), $translation);
} else {
return strtr(date(func_get_arg(0)), $translation);
};
}
?>
Теперь выводим где нужно:
<?php echo russian_date("l, j F Y г."); ?>
В выводе, можно менять последовательность (день, месяц, год) и добавит стили по вкусу.
Не дорого и в срок разработаем сайт для Вас.
Бесплатная консультация по телефону:
Комментарии
ԝhat I was ⅼooking for :Ɗ Ьesides saved tо favorites.
Also visit my webpage ... top online casino: https://Telecomdrive.com/which-casino-bonuses-are-beneficial-and-which-are-not/
identified the important points shared in your site.
Going through your blog publication is a real fantastic experience.
Thank you for taking into account readers like me, and
I wish you the best of success for a professional in this field.
Also visit my web page Fat Burner Combo: https://www.birdpix.nl/pphlogger/dlcount.php?id=birdpix&url=https://www.groupfrog.com/site/fatburncomboreview.com
Thank you so much and I'm taking a look forward to contact you.
Will you please drop me a e-mail?
Here is my page; 徳島 相続: https://sociedadeforteana.com.br/index.php/Soil_Dealing_With_And_Disposal_In_Ottawa_-_24hr_Emergency_Service
I like what I see so i am just following
you. Look forward to finding out about your web page again.
Feel free to visit my blog :: homepage: https://www.litefinance.org/ru/?uid=715509006
смотреть порно юных девушек https://besporno.online/: https://besporno.online/
https://sisi-pisi.vip/: https://sisi-pisi.vip/ порно толстые скачать бесплатно: https://profursetka.club/ молодежь анал
порно домашнее сперма жену https://ohuennoe.vip/: https://ohuennoe.vip/ после порно
зрелые
https://mamkineb.xyz/: https://mamkineb.xyz/ порно анал дома
Μy wweb рage :: Desdie Kenny (Renate: https://www.giannalbertobendazzi.com/libro-di-disegni-un-tuffo-nel-mondo-di-simone-massi/)
on your weblog. Is this a paid theme or did you modify it yourself?
Either way keep up the excellent quality writing, it is rare to see a nice blog like this one nowadays.
Feel free to surf to my blog post :: Instagram account creator
finder: https://insuitersolutions.wixsite.com/social-media-solutio/post/3-ways-to-see-who-created-an-instagram-account
thoroughly enjoying your blog. I too am an aspiring blog blogger but
I'm still new to everything. Do you have any helpful hints for first-time blog writers?
I'd certainly appreciate it.
Have a look at my website ... discuss: https://ondashboard.win/story.php?title=PROSTYE-SHAKHMATNYE-ZADACHI
Feel free to surf to my homepage :: moodlearabia.or g: https://moodlearabia.org/blog/index.php?entryid=1553
I really like what you've acquired here, really
like what you're stating and the way in which you say it.
You make it enjoyable and you still take care of to keep it smart.
I can't wait to read far more from you. This is really a wonderful web site, www.studiolegalepierotti.it: https://www.studiolegalepierotti.it/cessione-del-quinto-studio-pierotti/,.
I'm hoping to check out the same high-grade content from you later on as well.
In truth, your creative writing abilities has encouraged me to get my own blog now ;)
Feel free to surf to my blog - Canaan Unveils Bitcoin Mining
Machine: https://accounts.binance.com/ru/register?ref=25293193
Feel free to surf to my site https://circleofhopecommunity.com/: https://circleofhopecommunity.com/forums/topic/personulega-heimili-thitt-med-kofunarsprengjum-og-ibuum-theirra/
I really like all of the points you've made.
My web blog: best
round yoga mats: https://maize-grouse-35f.notion.site/Best-Round-Yoga-Mats-Premium-Quality-Unique-Prices-a5add8e5418e4e829defdfb4ee495194
sum it up what I had written and say, I'm thoroughly enjoying your blog.
I as well am an aspiring blog writer but I'm still new to the whole thing.
Do you have any tips for rookie blog writers? I'd certainly appreciate
it.
Look into my web page; Best website: http://google.com
enjoy to gain knowledge of more and more.
my webpage ... blogarama.in.ne t: https://blogarama.in.net/profile/DelorisZdh
My web site https://www.mazafakas.com: https://www.mazafakas.com/user/profile/1711680
short article has some wonderful tips.
Also visit my website; Thank You Teacher Gifts,: https://mysymphonic.com/2023/01/09/thank-you-teacher-gift-ideas/
and I'm surprised why this accident did not came about in advance!
I bookmarked it.
Also visit my web-site :: interiors room: https://directory.pagetrafficexpert.com/user/profile/11
simply pay a visit tһis site daily Ьecause it presents feature contents, thɑnks
Μy web page Btcc Online Casino (Http://Lopezclean.Com: http://lopezclean.com/yclas/furniture/the-guide-for-internet-gambling-beginners-of-online-casinos-directory.html)
I'm looking to start my own blog in the near future but
I'm having a hard time selecting between BlogEngine/Word press/B2evoluti on and Drupal.
The reason I ask is because your layout seems different then most blogs and I'm looking for something completely unique.
P.S Apologies for getting off-topic but I had
to ask!
Also visit my webpage ... site (mnwiki.org: https://mnwiki.org/index.php/User:UtaKaler531)
ѕo I have been ⅼooking around for tһe best site to get one.
Could үou tеll me pleɑse, ᴡhere ϲould i find some?
Feel free tо surf tօ my website Leilani Sykes: https://cibcaban.net/archives/904/img_2937_r
(from what I've read)Iѕ tat whаt you are usіng on yⲟur blog?
Ⅿy web page: safe online casino: https://beerconnoisseur.com/blogs/top-popular-drinks-order-casino/
know then you can write otherwise it is complex to write.
Feel free to visit my web blog ... april 2023 free pdf
calendar (bluesoleil.com : http://bluesoleil.com/forum/thread-2-153241-1.html)
my web site - australian online casinos: https://jostyle.pl/index.php/component/k2/item/5
problems with your website. It appears like some of the text within your posts are running off the screen. Can someone else please provide feedback
and let me know if this is happening to them as well? This could be a
problem with my browser because I've had this happen previously.
Appreciate it
Feel free to surf to my page: k: https://controlc.com/cbfd8e0a
any other web site which provides such data in quality?
Here is my web-site :: Custom Pet
Illustration: https://agla.cat/index.php/2018/05/21/hola-mundo/
new to me. Anyways, I'm certainly pleased I discovered
it and I'll be bookmarking it and checking back regularly!
Also visit my web site - fafa212: https://www.montauk-online.com/cgibin/tracker.cgi?url=https://fafa212vip.com/
Stay up the great work! You understand, lots of people are
searching round for this information, you could aid them
greatly.
Feel free to surf to my web site ... ArousalX CBD Gummies: http://lifestylesincometaxfree.com/__media__/js/netsoltrademark.php?d=itech.ru%2Fphpinfo.php%3Fa%255B%255D%3D%253Ca%2Bhref%253Dhttps%253A%252F%252Farousalxcbd.net%253EArousal%2BX%2BCBD%253C%252Fa%253E%253Cmeta%2Bhttp-equiv%253Drefresh%2Bcontent%253D0%253Burl%253Dhttps%253A%252F%252Farousalxcbd.net%2B%252F%253E
today, yet I never found any interesting article like yours.
It's pretty worth enough for me. In my opinion, if all website owners and bloggers
made good content as you did, the net will be a lot more useful than ever before.
Feel free to visit my blog post :: how to reactivate instagram account: https://insuitme.mystrikingly.com/blog/how-i-got-my-disabled-instagram-account-back-without-any-problem
here, I am truly enjoying by these.
Also visit my web-site ... a: https://telegra.ph/On-the-internet-Games-01-27
it to a few pals ans additionally sharing in delicious.
And certainly, thanks in your sweat!
Also visit my page :: купить удостоверение допог: https://browfamily.net/index.php/Are_Hybrid_Vehicles_Costlier_To_Insure
My web site; https://psychic444.com: https://psychic444.com/index.php?page=user&action=pub_profile&id=12703
I am reading this great paragraph to increase myy experience.
Feeel free t᧐ visit my website triviador: https://pickleballbay.com/best-pickleball-bags/
I've joined your rss feed and stay up for in search of more ⲟf your wonderfսⅼ
post. Аdditionally, I'ᴠе shared your site in my soсial networkѕ
Have a look at my website ... all bitcoin online casino play freе: http://media.lannipietro.com/album.aspx?album=namibia2011&return=https%3A%2F%2Fwolffiles.de%2Findex.php%3Fnews-918