• 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

How do I extract time/date individual data, Arduino ESP32?

Q&A Forum › Category: ESP32 › How do I extract time/date individual data, Arduino ESP32?
0 Vote Up Vote Down
Chris Gray asked 6 months ago

I’ve got the date/time example working but cannot find a way to get individual numbers or substrings. The project needs to reset itself at midnight, So I tried looking for a change in day. Generally, I’d like to make use of the individual time/date data variables. Can anyone help?

Question Tags: Arduino, date, date/time, ESP32, time, variables
9 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 6 months ago

Hi.
One of our readers published a sample code some time ago that can help.
Here it is: https://gist.github.com/Tech500/bc4bd77a357b8d401cd13487ef6de800
Regards,
Sara

0 Vote Up Vote Down
Sara Santos Staff answered 6 months ago

Let me know if this helps.
Regards,
Sara

0 Vote Up Vote Down
Chris Gray answered 6 months ago

Hi Sara, I will work through it during this week when time allows.
I’ve had a brief look but need a spare evening to get to grips.
Thank you

0 Vote Up Vote Down
Sara Santos Staff answered 6 months ago

Don’t worry.
Take your time.
Get back if you need further help.
Regards,
Sara

0 Vote Up Vote Down
Chris Gray answered 6 months ago

It runs to the point of waiting for the first valid timestamp, and then continues waiting. I think it might only work in the US. There is a link to more clues about the time zone, though they are just clues to me!

0 Vote Up Vote Down
Sara Santos Staff answered 6 months ago

Hi.
What do you mean?
Did you define the TZ variable to use your own timezone?
Regards,
Sara
 

0 Vote Up Vote Down
Chris Gray answered 6 months ago

No I didn’t change that to UK other than trying to fiddle the numbers. I looked at the supporting document but I’m afraid I could not see how to apply my time zone. Is that essential?

0 Vote Up Vote Down
Sara Santos Staff answered 6 months ago

You can easily find the timezone string here:https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv
If your timezone is London, this is what you should use:
GMT0BST,M3.5.0/1,M10.5.0

0 Vote Up Vote Down
Chris Gray answered 6 months ago

Thanks Sara, I’ll try to check later today 

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] ESP32-CAM Projects (version 1.3) January 7, 2023
  • [eBook Updated] SMART HOME with RPi, ESP32, and ESP8266 (version 1.1) November 20, 2022

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.