Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to retrieve dayOfWeek, day, month, year? #86

Open
dsyleixa opened this issue Dec 25, 2019 · 5 comments
Open

how to retrieve dayOfWeek, day, month, year? #86

dsyleixa opened this issue Dec 25, 2019 · 5 comments
Labels
topic: documentation Related to documentation for the project type: enhancement Proposed improvement

Comments

@dsyleixa
Copy link

dsyleixa commented Dec 25, 2019

how to retrieve dayOfWeek, day, month, year?
(either using Unix time string or via extra functions, feat time zone offsets)
an example sketch shipping with this lib would be highly appreciated!

@SyCoTechs
Copy link

SyCoTechs commented Feb 6, 2020

This for Day, Month and Year:
https://randomnerdtutorials.com/esp32-ntp-client-date-time-arduino-ide/
And for Day of the Week you could use some kind of counter function, containing all Weekdays(Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) and starting from a known Date with Weekday with counting...

Edit:
Looks like someone made the Fix for this code here(didnt tried it myself):
gmag11/NtpClient#84

@dsyleixa
Copy link
Author

dsyleixa commented Feb 6, 2020

tbh, the split function of formatted date is quite complicated in order to get dayOfWeek, day, month, year in exactly that order additionally to time (hours, minutes, seconds, perhaps millisec)
It would be easier to get them by dedicated direct-call functions like

  • int formattedDate.hours
  • int formattedDate.minutes
  • int formattedDate.seconds
  • int formattedDate.millisec
  • char* formattedDate.dayOfWeek or String formattedDate.dayOfWeek
  • int formattedDate.day
  • int formattedDate.month
  • int formattedDate.year

@thekunalsaini
Copy link

@dsyleixa dedicated direct-call functions are available Please refer that.

@dsyleixa
Copy link
Author

@dsyleixa dedicated direct-call functions are available Please refer that.

what do you want to express?
what is available?
where is the documentation about all and everything?
where are all the related code examples?

@FrankyBoy
Copy link

FrankyBoy commented Jun 27, 2020

I'd also like to get day/month/year functions, as that would allow to implement daylight saving properly (as that actually follows quite simple rules in most places). Also for other use cases these might be convenient.

PS: #94 would address this topic, for example.

@per1234 per1234 added topic: documentation Related to documentation for the project type: enhancement Proposed improvement labels Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

5 participants