IT-Consultant: José Roca (PBWIN 10+/PBCC 6+) (Archive only) > Windows API Headers

AfxQuadTimeToStr

(1/1)

Pierre Bellisle:
Hola Jose,

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



--- Code: ---' ========================================================================================
' 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
' ========================================================================================

--- End code ---

Pierre Bellisle:
Yes it have been said previously by Frank Rogers at PowerBASIC forum

Chris Chancellor:
Hello Piere

have PB forum ban you?  haven't seen any of your posts or submission at that PB forum since april 2020

Pierre Bellisle:
Hi Chris,

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

Hope that all is good on your side too.

Pierre

Chris Chancellor:
Thanxx Pierre, good to hear that you are safe and well

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

Navigation

[0] Message Index

Go to full version