Britannian Date Formula

Post all your Ultima Online and UOGuide related discussion topics here.
User avatar
JC the Builder
Site Admin
Posts: 428
Joined: Fri Mar 11, 2011 2:52 pm
Contact:

Britannian Date Formula

Postby JC the Builder » Sat Jan 02, 2016 8:17 pm

Creating the new menu bar at the top freed up lots of space in the left column. So I brought back the Britannian Date feature that was around briefly many years ago. But I am not quite sure it is correct. Can someone take a look?

Code: Select all

$uo_release_date = 877737600; // September 25 1997 00:00:00
$current_time = time();
$uo_time_in_seconds = $current_time - $uo_release_date;

$real_days_since_release = $uo_time_in_seconds / 60 /60 / 24;
$uo_days_since_release = floor($uo_time_in_seconds / 60 / 120);

$uo_years_since_release = floor($uo_days_since_release / 876);

$uo_current_days_into_year = $uo_days_since_release % 876;

if($uo_current_days_into_year <= 73)
   $uo_month = 'January';
elseif($uo_current_days_into_year <= 146)
   $uo_month = 'February';
elseif($uo_current_days_into_year <= 219)
   $uo_month = 'March';
elseif($uo_current_days_into_year <= 292)
   $uo_month = 'April';
elseif($uo_current_days_into_year <= 365)
   $uo_month = 'May';
elseif($uo_current_days_into_year <= 438)
   $uo_month = 'June';
elseif($uo_current_days_into_year <= 511)
   $uo_month = 'July';
elseif($uo_current_days_into_year <= 584)
   $uo_month = 'August';
elseif($uo_current_days_into_year <= 657)
   $uo_month = 'September';
elseif($uo_current_days_into_year <= 730)
   $uo_month = 'October';
elseif($uo_current_days_into_year <= 803)
   $uo_month = 'November';
elseif($uo_current_days_into_year <= 876)
   $uo_month = 'December';

$uo_days_into_month = $uo_current_days_into_year % 73;
$uo_current_year = 289 + $uo_years_since_release;

echo $uo_month.' '.$uo_days_into_month.', '.$uo_current_year;


Of course if anyone is unfamiliar with how UO dates work: http://www.uoguide.com/Time

Return to “UOGuide Bulletin Board”

Who is online

Users browsing this forum: No registered users and 60 guests