Author Topic: AfxQuadTimeToStr  (Read 1256 times)

0 Members and 1 Guest are viewing this topic.

Offline Pierre Bellisle

  • JK-Mitglieder
  • Full Member
  • *
  • Posts: 126
  • User-Rate: +12/-7
AfxQuadTimeToStr
« on: January 19, 2021, 12:36:22 AM »
Hola Jose,

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


Code: [Select]
' ========================================================================================
' 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
' ========================================================================================
« Last Edit: January 22, 2021, 08:17:33 PM by Pierre Bellisle »

Offline Pierre Bellisle

  • JK-Mitglieder
  • Full Member
  • *
  • Posts: 126
  • User-Rate: +12/-7
Re: AfxQuadTimeToStr
« Reply #1 on: January 19, 2021, 12:44:37 AM »
Yes it have been said previously by Frank Rogers at PowerBASIC forum

Offline Chris Chancellor

  • Sr. Member
  • ****
  • Posts: 354
  • User-Rate: +0/-0
Re: AfxQuadTimeToStr
« Reply #2 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

Offline Pierre Bellisle

  • JK-Mitglieder
  • Full Member
  • *
  • Posts: 126
  • User-Rate: +12/-7
Re: AfxQuadTimeToStr
« Reply #3 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


Offline Chris Chancellor

  • Sr. Member
  • ****
  • Posts: 354
  • User-Rate: +0/-0
Re: AfxQuadTimeToStr
« Reply #4 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