miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

Setting up Buddha time (+543 years later than Jesus era started)

Author Anonymous
Guest
#1 | Posted: 24 Jan 2005 10:14 
I was wondering if it was possible to change the year format from e.g. 2005 to 2548?

Thanks

Author Team
8-)
#2 | Posted: 24 Jan 2005 11:52 | Edited by: Admin 
function convert_date($dateR){
$engMon=array('January','February','March','April','May','June','July' ,'August','September','October','November','December',' ');
$months=explode (':', $GLOBALS['l_months']);
$months[]=' ';
$year=date('Y',strtotime($dateR))+543;
$GLOBALS['dateFormat']=str_replace('Y', $year, $GLOBALS['dateFormat']);

if(isset($GLOBALS['timeDiff']) and $GLOBALS['timeDiff']!=0) $dateR=date($GLOBALS['dateFormat'],strtotime($dateR)+$GLOBALS['timeDif f']);
else $dateR=date($GLOBALS['dateFormat'],strtotime($dateR));
$dateR=str_replace($engMon,$months,$dateR);
return $dateR;
}

cursived are new strings.

Author Anonymous
Guest
#3 | Posted: 24 Jan 2005 12:58 
Thank for your reply.
I copied your new function convert_date to bb_function.php

It still does not work!
Year is still 2005

Author Team
8-)
#4 | Posted: 24 Jan 2005 13:03 
Don't copy the whole function, just insert 2 new lines in the old function.

It should work. I've checked on my server and it works.

Author Ivan
Advanced Member
#5 | Posted: 24 Jan 2005 13:18 | Edited by: Ivan 
Excuse me for the input, I only became curious, why is that the year to be another year after 500 years? :)

Author Anonymous
Guest
#6 | Posted: 24 Jan 2005 13:46 
To Ivan
Because my buddha year is 2548.
So I need to +543 years more form Jessus year.

To Team
I tried to add this 2 lines
$year=date('Y',strtotime($dateR))+543;
$GLOBALS['dateFormat']=str_replace('Y', $year, $GLOBALS['dateFormat']);

It still does not work again.
Do you have the other way?
Anyway Thank a millions

Author Team
8-)
#7 | Posted: 24 Jan 2005 14:10 
Which $dateFormat setting do you have?

You need to have 'Y' inside of it.

My example:

$dateFormat='j F Y H:i';

Author Anonymous
Guest
#8 | Posted: 24 Jan 2005 16:40 
I got it!
Thank You So Much.

I have another question.
If I want to show only 48 insted of 2548.
How could I do?
Thank in advance.

Author Team
8-)
#9 | Posted: 24 Jan 2005 16:44 | Edited by: Admin 
$GLOBALS['dateFormat']=str_replace('Y', substr($year,-2), $GLOBALS['dateFormat']);

Author Anonymous
Guest
#10 | Posted: 24 Jan 2005 20:21 
Thank You So Much
You did very good job!

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications / Setting up Buddha time (+543 years later than Jesus era started) Top

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

 Short link for this topic:

 ?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB