Click here to Skip to main content
15,894,343 members

Comments by samtoad (Top 9 by date)

samtoad 29-Apr-24 18:27pm View    
Rick York,
I did this, and it worked. W/o the "const int" statement, it abended.
void CopyDateStr( char * buffer, const char * datetext ) {
const int MaxDateLength = 11;
strncpy(dateout, datein, MaxDateLength);
dateout[MaxDateLength] = '\0';
return(1);
}
Thanks

The 'strncat' reminds me of the strncpy statement.
thx
samtoad 12-Mar-24 12:51pm View    
To all,

I finally figured the problem out, after experiences many trial_and_errors on one line at a time.
So stop scratching your head a little too hard. This is the solution...
The problem lies at line # "**".

printf(" We are in Std Time: %ws \n", dtzi.StandardName); /// The same approach with daylightdate.
** SEdaylightdate = dtzi.StandardDate; //// it worked.
///// I had to get the dtzi.StandardDate systemtime form into an external, but still in the
///// program, systemtime datatype. And the rest is history.
///// This piece of code is straight forward and very simple in approach.
SEdaylightdate.wYear = intccyrval; /// Only put in default CCYY value. I did this.
printf("Standard Time starts: ");
PrintSystemTime(&SEdaylightdate);
///// Here is the output. I put in the 2024 year value before printing.
///// Standard Time starts: 11-01-2024 ----- 02:00:00
///// this "date" data that MS provides is very cryptic. But the date is somewhat
///// there from what trial_ad _errors that I've found with and played with.

And again, many Thanks.
samtoad 11-Mar-24 21:11pm View    
In attempting to implement all these solutions, there have been no success'. All I'm trying to do is to convert these two dates, the standard and daylightsavings dates, into a systemtime/TM readable form and then onto human readable forms.
In reviewing these dates, both are of systemtime datatypes. It seems like everything is of "systemtime" datatypes and would seem easy, but not. Are there any working "C" examples showing these smooth conversions, so to avoid any confusion. I'll keep working on my side. Thanks for the continued help. Samtoad.
samtoad 11-Mar-24 13:14pm View    
Hey Pete...,

In attempting to impliment your solution, the MSVC2019 compiler kicked out the function(SystemTimeToLocalFileTime) as
undefined... I didn't find any material on the subject(function); thinking that I was missing a certain ".h" include file,
but nope. Were you thinking of using another function? When I did the search on 'SystemTimeToLocalFileTime', it responded
back with a question saying is what you mean: System Time To Local File Time... I said yes, ...
It further goes into the topic of "FileToLocalFileTime". All I wanted to do is to convert two dates, within the timeZoneInfo area,
into a readable Date/Time forms and not get into any timezone stuff. Thanks though, Samtoad.
samtoad 2-Jun-23 11:03am View    
You know,... with a little kindness, courtesy, and consideration are attributes; when working with people, can go a long way if used correctly. I have the answer(s) that I was looking for, and with a little bit of rewriting; it works! The answer(s) turned about to be very simple and could have even
amazed you. Thanks.