App/lib/00_main.php

33 lines
1.3 KiB
PHP
Executable File

<?php #lib/main.php
/********************************************************************************
* Content: Most important functions *
* Author: Nils Otterpohl *
* Last modification: 24.06.2019 *
* Version: alpha (incomplete, tested, commented) *
********************************************************************************/
function myDate($time = 0) { //Formats timestamp to standard date format
if ($time==0) $time = time();
return date(FORMATDATE, $time);
}
function myTime($time = 0) { //Formats timestamp to standard time format
if ($time==0) $time = time();
return date(FORMATTIME, $time);
}
function myDateTime($time = 0) { //Formats timestamp to standard date and time format
return myDate($time)." ".myTime($time);
}
function fmtTime($format, $time = 0) { //Formats timestamp to a preset value
global $times;
return (isset($times[$format]) ? date($times[$format], $time) : myDateTime);
}
function addError($ident, $add) { //Lists an error
global $err;
if (isset($err[$ident])) $err["out"][] = $err[$ident].$add;
else $err["out"][] = $err["unknown"].$ident.$add;
}