Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

clock()

Purpose

Get the current date and time

Description

Returns a structure containing the current system date and time

Syntax

c = clock( )

Arguments

c.year current year

c.month current month of the year (1-12)

c.day current day of the month (1-31)

c.hour current hour (1-24)

c.minute current minute (0-59)

c.second current second (0-59)

Example

hour = "00"
minute = "00"
second = "00"
size = 100.0
textSize( size )
loop
    clear()
    c = clock()
    if c.hour < 10 then
        hour = "0" + str( c.hour )
    else
        hour = str( c.hour )
    endIf
    if c.minute < 10 then
        minute = "0" + str( c.minute )
    else
        minute = str( c.minute )
    endIf
    if c.second < 10 then
        second = "0" + str( c.second )
    else
        second = str( c.second )
    endIf
    now = hour + ":" + minute + ":" + second
    tw = textWidth( now )
    drawText( ( gwidth() - tw ) / 2, ( gheight() - size ) / 2, size, white, now )
    update()
repeat

Associated Commands

setTimer(), sleep(), startTimer(), stopTimer(), time()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.