Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f48e1e6
)
made date conversion programs default to the current year (not 2000)
author
Jason Woofenden
<jason183@herkamire.com>
Fri, 12 Oct 2007 09:35:26 +0000
(
05:35
-0400)
committer
Jason Woofenden
<jason183@herkamire.com>
Fri, 12 Oct 2007 09:35:26 +0000
(
05:35
-0400)
time.php
patch
|
blob
|
history
diff --git
a/time.php
b/time.php
index
81f4048
..
a3bc761
100644
(file)
--- a/
time.php
+++ b/
time.php
@@
-81,7
+81,11
@@
function mdy_to_ymd($date) {
switch(count($parts)) {
case 1:
$year = $parts[0];
switch(count($parts)) {
case 1:
$year = $parts[0];
- list($month, $day) = explode('/', date('m/d'));
+ if(strlen($year) == 0) {
+ list($month, $day, $year) = explode('/', date('m/d/Y'));
+ } else {
+ list($month, $day) = explode('/', date('m/d'));
+ }
break;
case 2:
list($month, $year) = $parts;
break;
case 2:
list($month, $year) = $parts;
@@
-104,7
+108,11
@@
function ymd_to_mdy($date) {
switch(count($parts)) {
case 1:
$year = $parts[0];
switch(count($parts)) {
case 1:
$year = $parts[0];
- list($month, $day) = explode('-', date('m-d'));
+ if(strlen($year) == 0) {
+ list($year, $month, $day) = explode('-', date('Y-m-d'));
+ } else {
+ list($month, $day) = explode('-', date('m-d'));
+ }
break;
case 2:
list($year, $month) = $parts;
break;
case 2:
list($year, $month) = $parts;