Jose's Read Only Forum 2023

IT-Consultant: José Roca (PBWIN 10+/PBCC 6+) (Archive only) => Windows API Headers => Topic started by: Pierre Bellisle on January 19, 2021, 12:36:22 AM

Title: AfxQuadTimeToStr
Post by: Pierre Bellisle on January 19, 2021, 12:36:22 AM
Hola Jose,

Not sure if this has been said before...
In any case, here it is...



' ========================================================================================
' Converts a time stored in a QUAD into a string.
' ========================================================================================
FUNCTION AfxQuadTimeToStr (BYVAL qTime AS QUAD) AS WSTRING
   IF qTime = 0 THEN EXIT FUNCTION

   'LOCAL ST AS SYSTEMTIME, FT AS FILETIME, bstrDateSep AS WSTRING
   'bstrDateSep  = AfxGetLocaleDateSeparator
   'FT.qDateTime = qTime
   'FileTimeToSystemTime(FT, ST)
   'FUNCTION = FORMAT$(ST.wDay,"00") & bstrDateSep & _
   '           FORMAT$(ST.wMonth,"00") & bstrDateSep & _
   '           FORMAT$(ST.wYear,"00")

   'Changed bstrDateSep to bstrTimeSep and AfxGetLocaleDateSeparator to AfxGetLocaleTimeSeparator.
   LOCAL ST AS SYSTEMTIME, FT AS FILETIME, bstrTimeSep AS WSTRING
   bstrTimeSep  = AfxGetLocaleTimeSeparator 'https://forum.powerbasic.com/forum/jose-s-corner/downloads/61213-windows-api-headers-iii-v-1-07?p=802868#post802868
   FT.qDateTime = qTime
   FileTimeToSystemTime(FT, ST)
   FUNCTION = FORMAT$(ST.wDay,"00")   & bstrTimeSep & _
              FORMAT$(ST.wMonth,"00") & bstrTimeSep & _
              FORMAT$(ST.wYear,"00")
END FUNCTION
' ========================================================================================
Title: Re: AfxQuadTimeToStr
Post by: Pierre Bellisle on January 19, 2021, 12:44:37 AM
Yes it have been said previously by Frank Rogers at PowerBASIC forum (https://forum.powerbasic.com/forum/jose-s-corner/downloads/61213-windows-api-headers-iii-v-1-07/page2#post802868)
Title: Re: AfxQuadTimeToStr
Post by: Chris Chancellor on January 20, 2021, 05:39:02 AM
Hello Piere

have PB forum ban you?  haven't seen any of your posts or submission at that PB forum since april 2020
Title: Re: AfxQuadTimeToStr
Post by: Pierre Bellisle on January 22, 2021, 08:23:55 PM
Hi Chris,

All is fine, I've got other things in mind for now...

Hope that all is good on your side too.

Pierre

Title: Re: AfxQuadTimeToStr
Post by: Chris Chancellor on January 24, 2021, 10:11:11 PM
Thanxx Pierre, good to hear that you are safe and well

i'm also keeping myself safe by not going out of my apartment