Page 1 of 1

Time

Posted: Tue Oct 05, 2004 1:37 am
by Rebe
Debug FormatDate("%hh:%ii:%ss", Date()) ; Will display the time using the 00:00:00 format
How do you display in 12 hour time ? right now it is 24 hour

Posted: Tue Oct 05, 2004 1:59 am
by Beach
I'm not sure if there is a way to format it with the "FormDate" command but you do something like this with a procedure:

Code: Select all

Procedure.s CurrentTime()

  timenow = Date()
  hour.s = FormatDate("%hh",timenow)
  
  If Val(hour) < 12 
    fulltime$ = FormatDate("%hh:%iiam",timenow)
  Else
    If hour <> "12" : hour = Str(Val(hour) - 12) : EndIf 
    fulltime$ = hour + FormatDate(":%iipm",timenow)
  EndIf
   
  ProcedureReturn fulltime$
  
EndProcedure

Debug CurrentTime()

Posted: Tue Oct 05, 2004 2:23 am
by Rebe
I have the Procedure working with a clock and I can't change it to add one more Procedure . it won't work . Need to change it with that pice of code if i can .
Said can't run Procedure in a Procedure .

Posted: Tue Oct 05, 2004 2:58 am
by Beach
You could call "CurrentTime()" from your procedure. Maybe you could post the code if not, there are some incredible, wizard like, coders here... :)

Posted: Tue Oct 05, 2004 10:42 am
by Moonshine
Rebe wrote:I have the Procedure working with a clock and I can't change it to add one more Procedure . it won't work . Need to change it with that pice of code if i can .
Said can't run Procedure in a Procedure .
You can run a procedure inside another, but you cant declare one inside another.