When is Saturday?
#10

PHP код:
GetWeekName(day=0month=0year=0)
{
    new
        
sStr[24] = "Invalid",
        
iBissext = (year 100),
        
iWeekDay = (year 100);
     
    if(
month 3month += 12,year--;
    new 
iWeek = ((day + (month+1)*26/10 iBissext iBissext/iWeekDay/2*iWeekDay) % 7);
     
    
sStr =
    (
        (
iWeek == 0x0) ? ("Saturday") :
        (
iWeek == 0x1) ? ("Sunday")    :
        (
iWeek == 0x2) ? ("Morning")    :
        (
iWeek == 0x3) ? ("Tuesday"   :
        (
iWeek == 0x4) ? ("Wednesday") :
        (
iWeek == 0x5) ? ("Thursday") :
        (
iWeek == 0x6) ? ("Friday")  :  ("Invalid")
    );
    return 
sStr

Credits: [iPs] Drakins
Reply


Messages In This Thread
When is Saturday? - by tal_peretz - 30.06.2011, 17:47
Re: When is Saturday? - by CrazyBlob - 30.06.2011, 17:49
Re: When is Saturday? - by Jay. - 30.06.2011, 17:52
Re: When is Saturday? - by tal_peretz - 30.06.2011, 18:27
Re: When is Saturday? - by BigETI - 30.06.2011, 18:49
AW: When is Saturday? - by Nero_3D - 30.06.2011, 20:07
Re: When is Saturday? - by linuxthefish - 30.06.2011, 20:18
Re: When is Saturday? - by CrazyBlob - 30.06.2011, 22:02
Re: When is Saturday? - by tal_peretz - 30.06.2011, 23:44
Re: When is Saturday? - by Shadoww5 - 01.07.2011, 00:34

Forum Jump:


Users browsing this thread: 1 Guest(s)