Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix getTime() timezone#28

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
pennam wants to merge2 commits intoarduino-libraries:main
base:main
Choose a base branch
Loading
frompennam:get-time-unix

Conversation

@pennam
Copy link
Contributor

with this changes we ansure getTime is always using UTC timezone and we can check NTP is synced comparing output with UNIX epoch.

@github-actions
Copy link

Memory usage change @3b31d79

Boardflash%RAM for global variables%
arduino:mbed_portenta:envie_m7N/AN/AN/AN/A
arduino:renesas_portenta:portenta_c33🔺 +360 - +456+0.02 - +0.020 - 00.0 - 0.0
Click for full report table
Boardexamples/HTTPClient
flash
%examples/HTTPClient
RAM for global variables
%examples/HTTPSClient
flash
%examples/HTTPSClient
RAM for global variables
%examples/GetTime
flash
%examples/GetTime
RAM for global variables
%examples/GetLocation
flash
%examples/GetLocation
RAM for global variables
%examples/DeleteSMS
flash
%examples/DeleteSMS
RAM for global variables
%examples/ReceiveSMS
flash
%examples/ReceiveSMS
RAM for global variables
%examples/SendSMS
flash
%examples/SendSMS
RAM for global variables
%examples/ModemTerminal
flash
%examples/ModemTerminal
RAM for global variables
%
arduino:mbed_portenta:envie_m7N/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/AN/A
arduino:renesas_portenta:portenta_c334000.0200.04000.0200.04560.0200.04560.0200.03600.0200.03600.0200.03760.0200.04240.0200.0
Click for full report CSV
Board,examples/HTTPClient<br>flash,%,examples/HTTPClient<br>RAM for global variables,%,examples/HTTPSClient<br>flash,%,examples/HTTPSClient<br>RAM for global variables,%,examples/GetTime<br>flash,%,examples/GetTime<br>RAM for global variables,%,examples/GetLocation<br>flash,%,examples/GetLocation<br>RAM for global variables,%,examples/DeleteSMS<br>flash,%,examples/DeleteSMS<br>RAM for global variables,%,examples/ReceiveSMS<br>flash,%,examples/ReceiveSMS<br>RAM for global variables,%,examples/SendSMS<br>flash,%,examples/SendSMS<br>RAM for global variables,%,examples/ModemTerminal<br>flash,%,examples/ModemTerminal<br>RAM for global variables,%arduino:mbed_portenta:envie_m7,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/Aarduino:renesas_portenta:portenta_c33,400,0.02,0,0.0,400,0.02,0,0.0,456,0.02,0,0.0,456,0.02,0,0.0,360,0.02,0,0.0,360,0.02,0,0.0,376,0.02,0,0.0,424,0.02,0,0.0

@per1234per1234 added type: imperfectionPerceived defect in any part of project topic: codeRelated to content of the project itself labelsJul 19, 2025
Copy link
Contributor

@sebromerosebromero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks good but please add a commenthere and mention that this function will try to sync with an NTP server to get the current time.

pennam reacted with thumbs up emoji
@sebromero
Copy link
Contributor

@pennam Actually this is already implemented in the functiongetCellularTime. Can we use that one instead?

@sebromero
Copy link
Contributor

@pennam We would need to changegetNetworkTime togetNetworkUTCTime insidegetCellularTime. Not sure this has any side effects.

@pennam
Copy link
ContributorAuthor

getTime() is a private static function of the library, used to feedBearSSLClient as callback, it have to return time in UTC format and it cannot be called ascellular.getTime() and we cannot feedBearSSLClient withgetCellularTime()

To keep backward compatibility I've added a flag to getCellularTime() adding the possibility for the user the get localtime or utc time4b7a446

I'm splitting PR#29 to reduce the scope and make it more simple to review

@pennampennam closed thisJul 21, 2025
@pennampennam reopened thisJul 21, 2025
@pennam
Copy link
ContributorAuthor

To avoid duplication of NTPSync code we can add a private static method that only takes care of the NTPsync call and is called by both getTime() and getCellularTime().

@pennam
Copy link
ContributorAuthor

pennam commentedJul 22, 2025
edited
Loading

@sebromero please take a look at#32 🙂

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@sebromerosebromerosebromero requested changes

Assignees

No one assigned

Labels

topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@pennam@sebromero@per1234

[8]ページ先頭

©2009-2025 Movatter.jp