• Welcome to Jose's Read Only Forum 2023.
 

AfxQuadTimeToStr

Started by Pierre Bellisle, January 19, 2021, 12:36:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pierre Bellisle

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

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