All times are UTC [ DST ]




Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
  Offline
PostPosted: February 12th, 2017, 8:49 am 
Count

Joined: February 9th, 2016, 4:03 am
Posts: 82
The php posted here gives me 552 for this year. The date at top of forum says 545. And it's 546. something doesn't match up.

On the other hand, this bit of php seems to be accurate
Code:
<?php
$this_day = date('d'); //today
$this_month = date('m');
$this_year = date('Y');
$base_month = '7';
$base_year = '2009';

$month_diff = (($this_year - $base_year) * 12) + ($this_month - $base_month);
$canonyears_diff = $month_diff * 6;

$mod = array(-2,-1,0,1,2,3,3);
$year_mod = $mod[($this_day - 1) / 5]; // magic

$current_year = $canonyears_diff + $year_mod;
?>

_________________
Aren the Fallen

Cedrek Axefall
-Mayor of Graycott
-Earl of Graycott
-Corpse
-Traitor?


Top
 Profile  
Reply with quote  
  Offline
PostPosted: February 12th, 2017, 5:47 pm 
Count

Joined: April 13th, 2016, 6:40 pm
Posts: 120
Aren wrote:
The php posted here gives me 552 for this year. The date at top of forum says 545. And it's 546. something doesn't match up.

On the other hand, this bit of php seems to be accurate
Code:
<?php
$this_day = date('d'); //today
$this_month = date('m');
$this_year = date('Y');
$base_month = '7';
$base_year = '2009';

$month_diff = (($this_year - $base_year) * 12) + ($this_month - $base_month);
$canonyears_diff = $month_diff * 6;

$mod = array(-2,-1,0,1,2,3,3);
$year_mod = $mod[($this_day - 1) / 5]; // magic

$current_year = $canonyears_diff + $year_mod;
?>



Hhhmmmmm... I may have posted an old version of the code for the one. Let me check, I'll also try your version on my test site.

_________________
Brillant Wizard
Count of The Scarlet Territories


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC [ DST ]


Who is online

Users browsing this forum: Baidu [Spider] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Imperium - Modified by Rey phpbbmodrey