TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-27-2009, 08:31 PM   #1 (permalink)
The Contributor
 
pipesportugal's Avatar
 
Join Date: May 2008
Location: Oporto-Portugal
Posts: 32
Thanks: 11
pipesportugal is on a distinguished road
Default bisixth year

Hi everyone,

Can someone tell me if there is a php function that returns if a given year is a bisixth year or normal year ?

Thanks in advance,
pipesportugal
pipesportugal is offline  
Reply With Quote
Old 08-27-2009, 08:55 PM   #2 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

What the heck is a bisixth year? The term does not show up on google or dictionary.com
__________________

Village Idiot is offline  
Reply With Quote
Old 08-27-2009, 08:58 PM   #3 (permalink)
The Contributor
 
pipesportugal's Avatar
 
Join Date: May 2008
Location: Oporto-Portugal
Posts: 32
Thanks: 11
pipesportugal is on a distinguished road
Default

In reality I did just the same, I mean I translated the Portuguese word: bisexto to english at babelfish and that's what came back: bisixth.
It's the year when February has 29 days.
regards
pipesportugal is offline  
Reply With Quote
Old 08-27-2009, 09:01 PM   #4 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
Thanks: 2
Enfernikus is on a distinguished road
Default

A leap year I think he's referring to.
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Old 08-27-2009, 09:20 PM   #5 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

I figured it was lost in translation once I saw you were from Portugal, but I put it though bablefish....

This will tell you if its leap year (the year that has 366 days in it)
PHP Code:
function isLeapYear(int year)
{
    if(
year == 0)
    {
        return 
true;
    }
    else
    {
        return 
false;
    }

Basically what the code does is use the modulo operator to see if the year can be divided by four without any remainder. If it can be divided by four, its leap year.
__________________

Village Idiot is offline  
Reply With Quote
The Following User Says Thank You to Village Idiot For This Useful Post:
pipesportugal (08-27-2009)
Old 08-27-2009, 10:44 PM   #6 (permalink)
The Contributor
 
pipesportugal's Avatar
 
Join Date: May 2008
Location: Oporto-Portugal
Posts: 32
Thanks: 11
pipesportugal is on a distinguished road
Default

Thanks a lot guys.

pipesportugal
pipesportugal is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting name of array benton General 6 07-01-2009 03:03 AM
Happy New Year & Best Wishes! ReSpawN The Lounge 3 01-01-2008 01:11 AM


All times are GMT. The time now is 12:16 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design