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 include struct tm from C standard library? #29

Closed
michkowalczuk opened this issue Sep 27, 2023 · 2 comments
Closed

How to include struct tm from C standard library? #29

michkowalczuk opened this issue Sep 27, 2023 · 2 comments

Comments

@michkowalczuk
Copy link

michkowalczuk commented Sep 27, 2023

How to
#include <ctime>
to properly convert struct tm to Delphi?

Here is the structure definition:

struct tm {
   int tm_sec;         /* seconds,  range 0 to 59          */
   int tm_min;         /* minutes, range 0 to 59           */
   int tm_hour;        /* hours, range 0 to 23             */
   int tm_mday;        /* day of the month, range 1 to 31  */
   int tm_mon;         /* month, range 0 to 11             */
   int tm_year;        /* The number of years since 1900   */
   int tm_wday;        /* day of the week, range 0 to 6    */
   int tm_yday;        /* day in the year, range 0 to 365  */
   int tm_isdst;       /* daylight saving time             */	
};

https://en.cppreference.com/w/c/chrono/tm

@neslib
Copy link
Owner

neslib commented Sep 27, 2023

Hi. Chet is intended to convert 3rd-party headers only. It does not convert system header files since that would lead to a lot of bloat. Many system headers have already been converted by Embarcadero for you. For example, you can find the tm struct in the System.Win.Crtl unit for Windows, or in Posix.Time for all Posix platforms (which is currently all other platforms that Delphi supports).

@neslib neslib closed this as completed Sep 27, 2023
@michkowalczuk
Copy link
Author

michkowalczuk commented Sep 27, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants