• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Using WiFiUdp.h to find currentHour

Q&A Forum › Category: ESP8266 › Using WiFiUdp.h to find currentHour
0 Vote Up Vote Down
Paul French asked 2 years ago

I am trying to incorporate the time of day into my sketch, so that the relays will only activate between the hours of 8am to 11pm.   I can see that currentHour can be returned, but I am struggling to figure out the right if syntax to check for between 2 values.

I want to see if currentHour is between 8 and 23

2 Answers
0 Vote Up Vote Down
Steve Mercer answered 2 years ago
if(currentHour >= 8 && currentHour <= 23)
{
// Do Something
}
0 Vote Up Vote Down
Paul French answered 2 years ago

Thank you Steve.  

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2023 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.