Click here to Skip to main content
15,877,168 members

Comments by samtoad (Top 8 by date)

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: ");
///// 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.
samtoad 27-May-23 23:07pm View    
Thanks OriginalGriff and Richard MacCutchan. But in the mean time, what about providing some solid/working examples as requested, showing me what I have done wrong with some explanation, and then show me your working examples of how you fixed the problems. Like the following statement: "I have created a test version of your problem and it works fine. The dll can read the data from the StringBuilder object. Also, the returned time value is correctly stored as a long integer."

As for this statement, ""Also, I do not think you can use a StringBuilder reference in C# to corresponde to a char* in C;"", I have been using StringBuilder reference in C# to corresponde to a char * charvariable for a long time and they have worked quite well, and I have had no problems with them -- as you mentioned to the contrary.

I have worked on this project for a long time, and have worked out a lot of problems on my own. But now, I'm only looking for some help. Not a confrontation. Please, can you help.