An incredible program

Publisher:平和思绪Latest update time:2015-09-10 Source: eefocusKeywords:program Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
//  year     00-99
//  month:  01-12
//  day      01-31
unsigned  char  GetWeekFromDay(unsigned  char  year,unsigned  char  month,unsigned  char  day)
{
    if(  month  ==  ||  month  ==   
    {
        month  +=  12;
        if(  year>  )
            year--;
        else
            year  4;
    }

    //  Return the day of the week (Monday is 1 and Sunday is 7)
    return  1+((  day  2*month  3*(month+1)/5  year  year/4  %7);
}
Keywords:program Reference address:An incredible program

Previous article:How to pass global variables in multiple files
Next article:In-depth understanding of void type

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号