Documentation
  • Introduction
  • Components
    • User Interface
      • Button
      • Checkbox
      • Date Picker
      • Floating Button
      • Image
      • Label
      • List Picker
      • List View
      • List View Image and Text
      • Notifier
      • Radio Button
      • Rating Bar
      • Slider
      • Surface View
      • Spinner
      • Switch
      • TextBox
      • Time Picker
      • Web Viewer
    • Layout
      • Horizontal Arrangement
      • Horizontal Scroll Arrangement
      • Space
      • Table Arrangement
      • Vertical Arrangement
      • Vertical Scroll Arrangement
    • Media
      • Audio Picker
      • Camcorder
      • Camera
      • Image Picker
      • Metadata
      • OCR
      • Player
      • QR Code
      • Sound
      • Sound Recorder
      • Speech Recognizer
      • Text To Speech
      • Video Player
      • Yandex Translate
    • Drawing and Animation
      • Ball
      • Canvas
      • Image Editor
      • Image Sprite
    • Sensors
      • Accelerometer
      • Barcode Scanner
      • Clock
      • Finger Print
      • Gravity Sensor
      • Gyroscope Sensor
      • Light Sensor
      • Location Sensor
      • Magnetic Field Sensor
      • NearField
      • Orientation Sensor
      • Pedometer
      • Pressure Sensor
      • Proximity Sensor
      • Sound Sensor
      • Temperature Sensor
    • Social
      • Contact Picker
      • Email Picker
      • Google Account Picker
      • Phone Call
      • Phone Number Picker
      • Sharing
      • Texting
      • Twitter
    • Storage
      • File
      • Firebase DB
      • Fusiontables Control
      • SQLite
      • Tiny DB
      • Tiny Web DB
    • Connectivity
      • Activity Starter
      • Bluetooth Admin
      • Bluetooth Client
      • Bluetooth Server
      • Download
      • Network
      • Web
      • WiFi
    • Google
      • Google Account Picker
      • Google Maps
      • Google Shortlink
    • LEGO Mindstorms
      • NXT Drive
      • NXT Color Sensor
      • NXT Light Sensor
      • NXT Sound Sensor
      • NXT Touch Sensor
      • NXT Ultrasonic Sensor
      • NXT Direct Commands
      • EV3 Motors
      • EV3 Color Sensor
      • EV3 Gyro Sensor
      • EV3 Touch Sensor
      • EV3 Ultrasonic Sensor
      • EV3 Sound
      • EV3 UI
      • EV3 Commands
    • Monetization
      • AdMob Interstitial
      • AdMob Banner
      • AdMob Rewarded Video
      • Billing
      • Leadbolt
    • Device
      • Audio
      • Device Tools
      • Wallpaper
      • Package
      • Screenshot
    • Experimental
      • Push Notifications
      • Cloud DB
      • Notification
  • Blocks
    • Control
    • Logic
    • Math
    • Text
    • Lists
    • Colors
    • Variables
    • Procedures
    • Screen
    • Any Component
  • Testing
    • Live Development
      • Via WiFi
      • Via USB
    • Makeroid Companion
  • Extensions
    • List of Extensions
    • Creating Extensions
  • Other
    • Backpack
    • Release Notes
      • Andromeda
      • Beta Versions
    • Resources
      • Concept Cards
    • Terms of Service
Powered by GitBook
On this page
  • Properties
  • TimerAlwaysFires
  • TimerEnabled
  • TimerInterval
  • Events
  • Timer()
  • Methods
  • InstantInTime AddDays(InstantInTime instant, number days)
  • InstantInTime AddDuration(InstantInTime instant, Duration duration)
  • InstantInTime AddHours(InstantInTime instant, number hours)
  • InstantInTime AddMinutes(InstantInTime instant, number minutes)
  • InstantInTime AddMonths(InstantInTime instant, number months)
  • InstantInTime AddSeconds(InstantInTime instant, number seconds)
  • InstantInTime AddWeeks(InstantInTime instant, number weeks)
  • InstantInTime AddYears(InstantInTime instant, number years)
  • DayOfMonth(InstantInTime instant)
  • Duration(InstantInTime start, InstantInTime end)
  • DurationToSeconds(Duration duration)
  • DurationToMinutes(Duration duration)
  • DurationToHours(Duration duration)
  • DurationToDays(Duration duration)
  • FormatDate(InstantInTime instant, text pattern)
  • FormatDateTime(InstantInTime instant, text pattern)
  • FormatTime(InstantInTime instant)
  • GetMillis(InstantInTime instant)
  • Hour(InstantInTime instant)
  • InstantInTime MakeInstant(text from)
  • InstantInTime MakeInstantFromMillis(number millis)
  • Minute(InstantInTime instant)
  • Month(InstantInTime instant)
  • MonthName(InstantInTime instant)
  • InstantInTime Now()
  • Second(InstantInTime instant)
  • SystemTime()
  • Weekday(InstantInTime instant)
  • WeekdayName(InstantInTime instant)
  • Year(InstantInTime instant)
  1. Components
  2. Sensors

Clock

Non-visible component that provides the instant in time using the internal clock on the phone.It can fire a timer at regularly set intervals and perform time calculations, manipulations, and conversions.

Methods to convert an instant to text are also available. Acceptable patterns are empty string, MM/DD/YYYY HH:mm:ss a, or MMM d, yyyy HH:mm. The empty string will provide the default format, which is "MMM d, yyyy HH:mm:ss a" for FormatDateTime, "MMM d, yyyy" for FormatDate. To see all possible format, please see here.

Date and Time are formatted with InstantInTime and Duration.

Instant : consists of Year, Month, DayOfMonth, Hour, Minute, and Second. An instant can be created by using MakeInstant method.

Duration : time in milliseconds elapsed between instants. Duration can be obtained by Duration method.

Properties

TimerAlwaysFires

Will fire even when application is not showing on the screen if true

TimerEnabled

Fires timer if true

TimerInterval

Interval between timer events in ms

Events

Timer()

Timer has gone off.

Methods

InstantInTime AddDays(InstantInTime instant, number days)

Returns an instant in time some days after the argument

InstantInTime AddDuration(InstantInTime instant, Duration duration)

Returns an instant in time some time after the argument. Duration can be obtained from Clock.Duration()

InstantInTime AddHours(InstantInTime instant, number hours)

Returns an instant in time some hours after the argument

InstantInTime AddMinutes(InstantInTime instant, number minutes)

Returns an instant in time some minutes after the argument

InstantInTime AddMonths(InstantInTime instant, number months)

Returns an instant in time some months after the argument

InstantInTime AddSeconds(InstantInTime instant, number seconds)

Returns an instant in time some seconds after the argument

InstantInTime AddWeeks(InstantInTime instant, number weeks)

Returns an instant in time some weeks after the argument

InstantInTime AddYears(InstantInTime instant, number years)

Returns an instant in time some years after the argument

DayOfMonth(InstantInTime instant)

Returns the day of the month(1-31) from the instant

Duration(InstantInTime start, InstantInTime end)

Returns duration, which is milliseconds elapsed between instants

DurationToSeconds(Duration duration)

Converts the duration to the number of seconds.

DurationToMinutes(Duration duration)

Converts the duration to the number of minutes.

DurationToHours(Duration duration)

Converts the duration to the number of hours.

DurationToDays(Duration duration)

Converts the duration to the number of days.

number DurationToWeeks(Duration duration)

Converts the duration to the number of weeks.

FormatDate(InstantInTime instant, text pattern)

Returns text representing the date of an instant in the specified pattern

FormatDateTime(InstantInTime instant, text pattern)

Returns text representing the date and time of an instant in the specified pattern

FormatTime(InstantInTime instant)

Return text representing the time of an instant

GetMillis(InstantInTime instant)

Returns the instant in time measured as milliseconds since 1970.

Hour(InstantInTime instant)

Returns the hour of the day(0-23) from the instant

InstantInTime MakeInstant(text from)

Returns an instant specified by MM/DD/YYYY hh:mm:ss or MM/DD/YYYY or hh:mm. An example text input is "06/22/2015 12:18"

InstantInTime MakeInstantFromMillis(number millis)

Returns an instant in time specified by the milliseconds since 1970.

Minute(InstantInTime instant)

Returns the minute of the hour (0-59) from the instant

Month(InstantInTime instant)

Returns the month of the year (1-12) from the instant

MonthName(InstantInTime instant)

Returns the name of the month from the instant E.g. January, February, March...

InstantInTime Now()

Returns an instant of the current time read from phone's clock

Second(InstantInTime instant)

Returns the second of the minute (0-59) from the instant

SystemTime()

Returns the phone's internal time

Weekday(InstantInTime instant)

Returns the day of the week represented as a number from 1 (Sunday) to 7 (Saturday)

WeekdayName(InstantInTime instant)

Returns the name of the day of the week from the instant

Year(InstantInTime instant)

Returns the year from the instant

PreviousBarcode ScannerNextFinger Print

Last updated 7 years ago