Time

Just starting out? Need help? Post your questions and find answers here.
Rebe
User
User
Posts: 73
Joined: Sun Jul 25, 2004 5:45 am

Time

Post 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
Beach
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Feb 02, 2004 3:16 am
Location: Beyond the sun...

Post 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()
Rebe
User
User
Posts: 73
Joined: Sun Jul 25, 2004 5:45 am

Post 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 .
Beach
Enthusiast
Enthusiast
Posts: 677
Joined: Mon Feb 02, 2004 3:16 am
Location: Beyond the sun...

Post 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... :)
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post 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.
Mark my words, when you least expect it, your uppance will come...
Post Reply