Files
2018-10-17 11:14:38 +03:00

81 lines
2.2 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of Date
*
* @author adm_azashchepkin
*/
class Date {
//put your code here
public static function changeDateToUnix($date){
$arr_date = explode("-", $date);
$U_date = mktime(0,0,0,$arr_date[0],$arr_date[1],$arr_date[2]);
return $U_date;
}
public static function changeLocaleDate($date){
$translate = 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" => "ое"
);
return strtr($date, $translate);
}
}