Clock
Last Updated On 2021-07-16
Version 4MinSDK 7Tutorial Video
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, yyyyHH: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.
Properties
You can set the below properties in the UI part of the builder.
- TimerAlwaysFires - it's a boolean value which is set to true by default.
- TimerEnabled - it's a boolean value which is set to true by default.
- TimerInterval - it's a non negative integer value which is set to 1000 by default.
Block Properties
You can set the below blocks properties in the blocks section of the builder.
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
Methods
You can set the below method blocks in the blocks section of the builder.
AddDays
Returns an instant in time some days after the given instant.
AddDuration
Returns an instant in time some duration after the argument
AddHours
Returns an instant in time some hours after the given instant.
AddMinutes
Returns an instant in time some minutes after the given instant.
AddMonths
Returns an instant in time some months after the given instant.
AddSeconds
Returns an instant in time some seconds after the given instant.
AddWeeks
Returns An instant in time some weeks after the given instant.
AddYears
Returns an instant in time some years after the given instant.
DayOfMonth
Returns the day of the month (1-31) from the instant.
Duration
Returns duration, which is milliseconds elapsed between instants.
DurationToDays
Converts the duration to the number of days.
DurationToHours
Converts the duration to the number of hours.
DurationToMinutes
Converts the duration to the number of minutes.
DurationToSeconds
Converts the duration to the number of seconds.
DurationToWeeks
Converts the duration to the number of weeks.
FormatDate
Text representing the date of an instant in the specified pattern
FormatDateTime
Returns text representing the date and time of an instant in the specified pattern
FormatTime
Text representing the time of an instant
GetMillis
Returns the instant in time measured as milliseconds since 1970.
Hour
Returns the hour of the day (0-23) from the instant.
MakeDate
Returns an instant in time specified by year, month, date in UTC. Valid values for the month field are 1-12 and 1-31 for the day field.
MakeInstant
Returns an instant in time specified by MM/dd/YYYY hh:mm:ss or MM/dd/YYYY or hh:mm.
MakeInstantFromMillis
Returns an instant in time specified by the milliseconds since 1970 in UTC.
MakeInstantFromParts
Returns an instant in time specified by year, month, date, hour, minute, second in UTC.
MakeTime
Returns an instant in time specified by hour, minute, second in UTC.
Minute
Returns the minute of the hour (0-59) from the instant.
Month
Returns the month of the year represented as a number from 1 to 12).
MonthName
Returns the name of the month from the instant, e.g., January, February, March...
Now
Returns the current instant in time read from phone's clock.
Second
Returns the second of the minute (0-59) from the instant.
SystemTime
Returns the phone's internal time.
Weekday
Returns the day of the week represented as a number from 1 (Sunday) to 7 (Saturday).
WeekdayName
Returns the name of the day of the week from the instant.
Year
The year
Events
You can set the below event blocks in the blocks section of the builder.
Timer
The Timer event runs when the timer has gone off.