CurrentHour
Result = CurrentHour()
 
Parameters: NONE
Returns:

    Result = The current hour
 

CurrentHour returns the current hour as an integer between 0 and 23.




Mini Tutorial:


Showing the use of the functions CurrentHour, CurrentMinute and CurrentSecond


  
; Start of Repeat/Until loop
  Repeat
     
   ; Clear the screen
     Cls RGB(0,0,0)
     
   ; put hour, minute and second to string variables
     h$ = Str$(CurrentHour())
     m$ = Str$(CurrentMinute())
     s$ = Str$(CurrentSecond())
     
   ; pad leading zeros
     If Len(h$) = 1 Then h$ = "0" + h$
     If Len(m$) = 1 Then m$ = "0" + m$
     If Len(s$) = 1 Then s$ = "0" + s$
     
   ; display the time
     Print h$ + ":" + m$ + ":" + s$
     
   ; Display the screen
     Sync
     
   ; repeat until the ESC key is pressed
  Until EscKey()=true
  
; End Program
  End
  
  




This example would output something like this.

  
  02:24:40
  
  


 
Related Info: CurrentDate$ | CurrentDay$ | CurrentMinute | CurrentMonth$ | CurrentSecond | CurrentTime$ | CurrentYear$ | Timer :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com