Project

General

Profile

1
<?php
2

    
3
// $Id: date_formats.php 213 2005-10-24 21:36:31Z stefan $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2005, Ryan Djurovich
9

    
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

    
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

    
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

    
24
*/
25

    
26
/*
27

    
28
Date format list file
29

    
30
This file is used to generate a list of date formats for the user to select
31

    
32
*/
33

    
34
// Define that this file is loaded
35
if(!defined('DATE_FORMATS_LOADED')) {
36
	define('DATE_FORMATS_LOADED', true);
37
}
38

    
39
// Create array
40
$DATE_FORMATS = array();
41

    
42
// Get the current time (in the users timezone if required)
43
if(isset($user_time) AND $user_time == true) {
44
	$mktime = mktime()+TIMEZONE;
45
} else {
46
	$mktime = mktime()+DEFAULT_TIMEZONE;
47
}
48

    
49
// Add values to list
50
$DATE_FORMATS['l,|jS|F,|Y'] = gmdate('l, jS F, Y', $mktime);
51
$DATE_FORMATS['jS|F,|Y'] = gmdate('jS F, Y', $mktime);
52
$DATE_FORMATS['d|M|Y'] = gmdate('d M Y', $mktime);
53
$DATE_FORMATS['M|d|Y'] = gmdate('M d Y', $mktime);
54
$DATE_FORMATS['D|M|d,|Y'] = gmdate('D M d, Y', $mktime);
55
$DATE_FORMATS['d-m-Y'] = gmdate('d-m-Y', $mktime).' (D-M-Y)';
56
$DATE_FORMATS['m-d-Y'] = gmdate('m-d-Y', $mktime).' (M-D-Y)';
57
$DATE_FORMATS['d.m.Y'] = gmdate('d.m.Y', $mktime).' (D.M.Y)';
58
$DATE_FORMATS['m.d.Y'] = gmdate('m.d.Y', $mktime).' (M.D.Y)';
59
$DATE_FORMATS['d/m/Y'] = gmdate('d/m/Y', $mktime).' (D/M/Y)';
60
$DATE_FORMATS['m/d/Y'] = gmdate('m/d/Y', $mktime).' (M/D/Y)';
61

    
62
// Add "System Default" to list (if we need to)
63
if(isset($user_time) AND $user_time == true) {
64
	if(isset($TEXT['SYSTEM_DEFAULT'])) {
65
		$DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $mktime).' ('.$TEXT['SYSTEM_DEFAULT'].')';
66
	} else {
67
		$DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $mktime).' (System Default)';
68
	}
69
}
70

    
71
// Reverse array so "System Default" is at the top
72
$DATE_FORMATS = array_reverse($DATE_FORMATS, true);
73

    
74
?>
(2-2/13)