// Calculate the day of the week for any day between 2000 and 2099 // 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; } // Returns 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); }
Previous article:ASCII 8×8 dot matrix font generator
Next article:Use STC12C5A60S2 to directly drive a 16*16 LED dot matrix display
Recommended ReadingLatest update time:2024-11-16 14:55
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Understanding wireless communication technology
- Infineon Tmall flagship store offers huge discounts Part 1 - Limited cashback on a first-come, first-served basis, Double 11 special promotion!
- Good evening, experts.
- You may need oscilloscope information urgently, especially analog ones. You can get the information here.
- XMC4800 Review (Part 2) - Unboxing and Lighting
- Share the use of Allegro Color command with everyone
- Comparison of technical indicators between N76E003AT20 and STM8S003F3P6
- CCS variable observer problem
- [NXP Rapid IoT Review] Rapid IoT Studio Simple Programming Step 4 Add Bluetooth RGB Light Control
- EEWORLD University - What is Dynamic Multi-Protocol Manager (DMM)?