AppyBuilder
  • AppyBuilder Introduction
  • Release Notes
  • Terms of Service
  • AppyBuilder Editors
    • Design Editor
    • Blocks Editor
    • Components
  • Live Testing
  • Components
    • Reference
      • User Interface
        • Button
        • Checkbox
        • Chronometer
        • DatePicker
        • FloatingButton
        • GalleryViewer
        • GridView
        • Image
        • Label
        • ListPicker
        • ListPickerCustom
        • ListView
        • ListViewCustom
        • Notifier
        • PasswordTextBox
        • ProgressBar
        • RatingBar
        • Slider
        • Spinner
        • Switch
        • TextBox
        • Toggler
        • WebViewer
        • TimePicker
        • LinedTextBox
      • Effects
        • Decoration
        • Sidebar
        • Snackbar
      • Layout
        • Horizontal Arrangement
        • Horizontal Scroll Arrangement
        • Table Arrangement
        • Vertical Arrangement
        • Vertical Scroll Arrangement
      • Drawing and Animation
        • Ball
        • Canvas
        • Image Sprite
      • Maps
        • Circle
        • FeatureCollection
        • LineString
        • Map
        • Marker
        • Polygon
        • Rectangle
      • Media
        • Camcorder
        • Camera
        • ImagePicker
        • Player
        • Sound
        • SoundRecorder
        • SpeechRecognizer
        • TextToSpeech
        • VideoPlayer
        • YandexTranslate
      • Connectivity
        • ActivityStarter
        • BluetoothClient
        • NetworkManager
        • Web
        • WiFiManager
      • LegoMindStorms
        • Ev3ColorSensor
        • Ev3Commands
        • Ev3GyroSensor
        • Ev3Motors
        • Ev3Sound
        • Ev3TouchSensor
        • Ev3UI
        • Ev3UltraSonicSensor
        • NxtDirectCommands
        • NxtDrive
        • NxtLightSensor
        • NxtTouchSensor
        • Ev3ColorSensor
      • Storage
        • Airtable
        • File
        • FirebaseDB
        • FTPManager
        • FusionTableControl
        • TinyDB
        • TinyWebDB
      • Sensors
        • Accelerometersensor
        • BarcodeScanner
        • BatteryManager
        • Clock
        • Gyroscopesensor
        • LightSensor
        • LocationSensor
        • MagneticFieldSensor
        • MemoryInfo
        • NearField
        • OrientationSensor
        • Pedometer
        • ProximitySensor
        • PressureSensor
        • SoundSensor
        • TemperatureSensor
        • ProximitySensor
      • Social
        • ContactPicker
        • EmailPicker
        • PhoneCall
        • PhoneNumberPicker
        • Sharing
        • Texting
        • Twitter
      • Experimental
        • CloudDB
      • Visualization
        • GoogleMap
        • XYChart
      • Advanced
        • KitchenSink
        • OneSignalPush
        • PushNotification
        • SQLite
      • Monetize
        • AdAmazon
        • AdAmazonInterstitial
        • AdMob
        • AdMobInterstitial
        • AdMobRewardedVideo
        • InAppBilling
        • MMediaInterstitial
  • Tutorials
    • Openstreet Map
    • OneSignalPush
    • Creating E-book
    • Basic
      • Simulating Progress Bar
      • Creating Splash Screen
      • Adding Privacy Policy
      • Package Name
      • Beginner - Talk to Me app
      • Beginner Tutorial
    • Animation
      • Animation & Collision Part I
      • Animation & Collision Part II
    • Monetization
      • AdMob Banner
      • AdMob Interstitial
      • AdMob Rewarded Video
      • Increasing Monetization Revenue
    • Using RadioButtons
    • keystore
    • Firebase - Advanced
  • Extensions
  • Concept Cards
    • Bouncing Sprites
    • Sprite Timed Movement
    • Sprite Movement on Timer
    • Adding Sound
    • Speech Recognition
    • Random Numbers
    • Fling Movement
    • Movement with Sensors
    • Drawing on Canvas
    • Multiple Screens
    • Creating Custom Colors
    • Movement with Buttons
    • Shaking Phone
    • Collision Detection
    • Dragging A Sprite
  • Advanced
    • Source File Structure
  • Code Editor
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. Reference
  3. 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

PreviousBatteryManagerNextGyroscopesensor

Last updated 7 years ago