Skip to content

NTPC: how to obtain "getHours" in 24 hrs format? #87

@xkosm14

Description

@xkosm14

Please let me know if is it possible to get NTC timeClient.getHours() in 24hrs format?
Always getting 12 hr format.

My piece of Arduino code:
Updating RTC chip with NTF time, if current time is 11PM then i got "11" but need "23":

rtc.adjust(DateTime(YEAR, MONTH, DAY, timeClient.getHours(), timeClient.getMinutes(), SE)); 

BTW I know there is a way to use different approach e.g. epoch time or parse getFormattedTime etc...

Metadata

Metadata

Assignees

Labels

conclusion: invalidIssue/PR not validtopic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions