Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
10fca7ca
Commit
10fca7ca
authored
12 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Reformat code for clarity
parent
a223eff8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/class.format.php
+15
-15
15 additions, 15 deletions
include/class.format.php
with
15 additions
and
15 deletions
include/class.format.php
+
15
−
15
View file @
10fca7ca
...
...
@@ -180,7 +180,7 @@ class Format {
}
/* elapsed time */
function
elapsedTime
(
$sec
){
function
elapsedTime
(
$sec
)
{
if
(
!
$sec
||
!
is_numeric
(
$sec
))
return
""
;
...
...
@@ -197,32 +197,32 @@ class Format {
/* Dates helpers...most of this crap will change once we move to PHP 5*/
function
db_date
(
$time
)
{
global
$cfg
;
return
Format
::
userdate
(
$cfg
->
getDateFormat
(),
Misc
::
db2gmtime
(
$time
));
return
Format
::
userdate
(
$cfg
->
getDateFormat
(),
Misc
::
db2gmtime
(
$time
));
}
function
db_datetime
(
$time
)
{
global
$cfg
;
return
Format
::
userdate
(
$cfg
->
getDateTimeFormat
(),
Misc
::
db2gmtime
(
$time
));
return
Format
::
userdate
(
$cfg
->
getDateTimeFormat
(),
Misc
::
db2gmtime
(
$time
));
}
function
db_daydatetime
(
$time
)
{
global
$cfg
;
return
Format
::
userdate
(
$cfg
->
getDayDateTimeFormat
(),
Misc
::
db2gmtime
(
$time
));
return
Format
::
userdate
(
$cfg
->
getDayDateTimeFormat
(),
Misc
::
db2gmtime
(
$time
));
}
function
userdate
(
$format
,
$gmtime
)
{
return
Format
::
date
(
$format
,
$gmtime
,
$_SESSION
[
'TZ_OFFSET'
],
$_SESSION
[
'TZ_DST'
]);
function
userdate
(
$format
,
$gmtime
)
{
return
Format
::
date
(
$format
,
$gmtime
,
$_SESSION
[
'TZ_OFFSET'
],
$_SESSION
[
'TZ_DST'
]);
}
function
date
(
$format
,
$gmtimestamp
,
$offset
=
0
,
$daylight
=
false
){
if
(
!
$gmtimestamp
||
!
is_numeric
(
$gmtimestamp
))
return
""
;
$offset
+=
$daylight
?
date
(
'I'
,
$gmtimestamp
)
:
0
;
//Daylight savings crap.
return
date
(
$format
,(
$gmtimestamp
+
(
$offset
*
3600
)));
}
function
date
(
$format
,
$gmtimestamp
,
$offset
=
0
,
$daylight
=
false
){
if
(
!
$gmtimestamp
||
!
is_numeric
(
$gmtimestamp
))
return
""
;
$offset
+=
$daylight
?
date
(
'I'
,
$gmtimestamp
)
:
0
;
//Daylight savings crap.
return
date
(
$format
,
(
$gmtimestamp
+
(
$offset
*
3600
)));
}
}
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment