miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Specific miniBB Support Forums / Specific /  
 

convert_date() for non English date

 
Author Andro
Partaker
#1 | Posted: 25 Jan 2005 22:32 
In versions 2.0 RC1g and below, there is a bug in function convert_date() (bb_functions.php), which doesn't correct (by $timeDiff) non english date. The modified function:

function convert_date($dateR){
$engMon=array('January','February','March','April','May','June','July' ,'August','September','October','November','December');
$months=explode (':', $GLOBALS['l_months']);
//$months[]=' ';
//if(isset($GLOBALS['timeDiff']) and $timeDiff!=0) $dateR=date($GLOBALS['dateFormat'],strtotime($dateR)+$GLOBALS['timeDif f']);
//else $dateR=date($GLOBALS['dateFormat'],strtotime($dateR));
if (isset($GLOBALS['timeDiff']
) and ($GLOBALS['timeDiff']!=0)) {
$dateR=str_replace($months,$engMon,$dateR);
$dateR=date($GLOBALS['dateFormat'],strtotime($dateR)+$GLOBALS['timeDif f']);
$dateR=str_replace($engMon,$months,$dateR);
}
return $dateR;
}

Author Ivan
Advanced Member
#2 | Posted: 26 Jan 2005 01:34 
I finished elementary school many years ago (our Lord refused me this happiness to continue my education) and it's possible that I had all forgotten. But may I allow myself to show you my screen of Club "Pierrot", taken one minute ago?

1. miniBB 2.0 RC1g.
2. Language - Bulgarian.
3. Country - Bulgaria.
4. Alphabet - Cyrillic.
5. Dates - Bulgarian style.
6. Hours - Bulgarian style.
7. Months - in Bulgarian.
8. Hosting - Bulgarian.
9. Time - GMT + 2.

All is perfect. The same was with RC1f.

In RC1f I had set the date format as "DD MM YYYY" and it worked.

Now I left the default format "$dateFormat='j F Y H:i:s';"
What exactly is not converted correctly?

Author Andro
Partaker
#3 | Posted: 26 Jan 2005 04:18 
Do you use $timeDiff option?

Author Ivan
Advanced Member
#4 | Posted: 26 Jan 2005 09:35 
No, and I didn't intended so by now. I even noticed (through FTP) that my server uses GMT. But! In the same time my forum/club works with the correct local time.

For example: I upload a file and see the time on the server - 10.23. In that same moment I post a message. It appears with the correct Sofia time - 12.23.

That makes me thinking that this correction concerns the server, not your machine. Simply have a look at your server's date and time, and if it's correct for you, try not to correct it additionaly in your options.

If this is the case, what you propose will make the function from right to wrong.

Only an opinion.

Author Andro
Partaker
#5 | Posted: 26 Jan 2005 18:18 
I spoke about an issue, when $timeDiff is setup and when you are using a non english date. In other cases all is ok.

Author Team
8-)
#6 | Posted: 27 Jan 2005 10:43 
Andro
I didn't completely understand what is "non-english" date and how it is connected to date/time difference. When we add the numerical difference, it is added in SECONDS and has nothing in common to international settings. Probably, you have just incorrectly setup date format in settings; month MUST be defined by "F" letter, and when converting date, english month definitions are replaced to these you have in language pack.

Author Andro
Partaker
#7 | Posted: 28 Jan 2005 02:45 
Yes there were a small proplem with date format, as I moved to 2 version from 1.7. There is no bug in function, now the situation is clear. I apologize for wrong conclusion.

Specific miniBB Support Forums / Specific /
 convert_date() for non English date
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑