// year : 00-99
// month: 01-12
// day : 01-31
unsigned char GetWeekFromDay(unsigned char year,unsigned char month,unsigned char day)
{
if( month == 1 || month == 2 )
{
month += 12;
if( year> 0 )
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
//
//
unsigned
{
}
Previous article:How to pass global variables in multiple files
Next article:In-depth understanding of void type
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
MoreDaily News
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
Guess you like
- How to build a Keil project using the LPC8xx ROM?
- New infrared temperature measurement thermal imager is coming! AutoNavi holds a press conference in Beijing!
- Divide an assembly file into several assembly files. Compile prompt variable is not defined
- RF amplifier performance test
- What kind of feedback is introduced in the following circuit?
- What is the significance of connecting two capacitors in series?
- Storage time of different surface treatment processes for circuit boards
- Upgraded AMG8833 PyGamer thermal imager
- LED Dress
- Future unemployment issues facing electronic engineers