Thread: timevar
View Single Post
  #16  
Old 05-03-2005, 12:46 AM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
ALL!... Except Graal.

PHP Code:
function date()
{
  
this.time int(timevar2);
  
this.day int(int(this.time/(60*60*24))%365.242199);
  
this.month := find_month(this.day);
  
this.year 1970 int(this.time/(60*60*24*365.242199));

  return 
this.month[0] @ "/" @ (this.month[1] + 1) @ "/" this.year;
}

function 
find_month(day)
{
  
:= 0;
  while (
true)
  {
    if (
day days_in_month(i))
      return {
day,i};

    
day -= days_in_month(i);
    
++;
  }
}

function 
days_in_month(month)
{
  return (
month == 28 30 + (month 2));

I don't have it leap years intergrated, but the next leap year is in three years. This is what I made
__________________
In a world of change... Who'll you believe?
Reply With Quote