-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdate.inc.php
40 lines (38 loc) · 1.05 KB
/
date.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
error_reporting(E_ALL);
ini_set('display_errors', '0');
function datetime_to($datetime=""){
$unixdatetime = strtotime($datetime);
return strftime("%B %d, %Y at %I:%M %p", $unixdatetime);
}
function dates($datetime=""){
$unixdatetime = strtotime($datetime);
return strftime("%B %d | %Y ", $unixdatetime);
}
function datetime($datetime=""){
$unixdatetime = strtotime($datetime);
return strftime("%B %d | %I:%M %p", $unixdatetime);
}
function date_only($datetime=""){
$unixdatetime = strtotime($datetime);
return strftime("%B %d, %Y ", $unixdatetime);
}
function time_only($datetime=""){
$unixdatetime = strtotime($datetime);
return strftime("%I:%M %p ", $unixdatetime);
}
function year_only($datetime=""){
$unixdatetime = strtotime($datetime);
return strftime("%Y ", $unixdatetime);
}
function no_year($datetime=""){
$unixdatetime = strtotime($datetime);
return strftime("%m%d", $unixdatetime);
}
function redirect_to( $location = NULL ) {
if ($location != NULL) {
header("Location: {$location}");
exit;
}
}
?>