web-site-public-php/sys/semantics.php

16 lines
621 B
PHP

<?php
function html_date($format, $time) {
return "<time datetime=\"" . gmdate('Y-m-d', $time) . "\">" . gmdate($format, $time) . "</time>";
}
function html_datetime($format, $time) {
return "<time datetime=\"" . gmdate(DateTimeInterface::ATOM, $time) . "\">" . gmdate($format, $time) . "</time>";
}
function html_date_const($format, $year, $month, $day) {
return html_date($format, gmmktime(0, 0, 0, $month, $day, $year));
}
function html_datetime_const($format, $year, $month, $day, $hour, $minute, $second) {
return html_datetime($format, gmmktime($hour, $minute, $second, $month, $day, $year));
}
?>