The DigitalClock element has the following attributes:
Required attributes
The following attributes are required:
x, y, width, height
Optional attributes
The following attributes are optional:
A collection of integers that specify the element's size and position.
pivotX, pivotY
A two-dimensional pivot point about which the element rotates. Both values
are floating-point numbers that are scaled to fit in the range $ [0, 1] $.
angle
A number of degrees, clockwise, that the element should be rotated about its
pivot point.
alpha
Set the level of transparency that this element should have. A value of 0
indicates that the element should be completely transparent. A value of 255
indicates that the element should be completely opaque.
scaleX
The horizontal scaling factor to apply to this element.
scaleY
The vertical scaling factor to apply to this element.
renderMode
The element's render mode type. Possible values are: SOURCE (default),
MASK, or ALL.
tintColor
Apply a tint color filter to the element. You must specify the color using
either the ARGB format (#ff000000 = opaque black) or the RGB format
(#000000 = black).
Inner elements
The DigitalClock element can contain the following inner elements:
TimeText
A collection of formatted strings to show the hours, minutes, and seconds
associated with a current clock time.
Localization
Provides a hint for the locale to use when rendering the time. More
information is available in the Localization reference.
A DigitalClock element can contain at most one Localization element.
Variant
Allows for changing attributes of this element when the Wear OS device is in
ambient mode. More information is available in the Variant reference.
Recommended for you
Note: link text is displayed when JavaScript is off
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-20 UTC."],[],[],null,["# DigitalClock\n\nWatch Face Format version Version 4 Version 3 Version 2 Version 1\n\n*** ** * ** ***\n\nA digital clock is a container for a formatted set of strings that represent the\ncurrent hours, minutes, and seconds associated with a clock time.\n\nIntroduced in Wear OS 4.\n\nSyntax\n------\n\n```xml\n\u003cDigitalClock x=\"integer\" y=\"integer\" width=\"integer\" height=\"integer\"\n pivotX=\"float\" pivotY=\"float\" angle=\"float-degrees\" alpha=\"integer\"\n scaleX=\"float\" scaleY=\"float\"\n renderMode=\"[SOURCE | MASK | ALL]\"\n tintColor=\"argb-color | rgb-color\"\u003e\n \u003c!-- This is the only required inner element. --\u003e\n \u003cTimeText ... /\u003e\n\u003c/DigitalClock\u003e\n```\n\nAttributes\n----------\n\nThe `DigitalClock` element has the following attributes:\n\n### Required attributes\n\nThe following attributes are required:\n\n`x`, `y`, `width`, `height`\n\n### Optional attributes\n\nThe following attributes are optional:\n: A collection of integers that specify the element's size and position.\n\n`pivotX`, `pivotY`\n: A two-dimensional pivot point about which the element rotates. Both values\n are floating-point numbers that are scaled to fit in the range $ \\[0, 1\\] $.\n\n`angle`\n: A number of degrees, clockwise, that the element should be rotated about its\n pivot point.\n\n`alpha`\n: Set the level of transparency that this element should have. A value of `0`\n indicates that the element should be completely transparent. A value of `255`\n indicates that the element should be completely opaque.\n\n`scaleX`\n: The horizontal scaling factor to apply to this element.\n\n`scaleY`\n: The vertical scaling factor to apply to this element.\n\n`renderMode`\n: The element's render mode type. Possible values are: `SOURCE` (default),\n `MASK`, or `ALL`.\n\n`tintColor`\n: Apply a tint color filter to the element. You must specify the color using\n either the ARGB format (`#ff000000` = opaque black) or the RGB format\n (`#000000` = black).\n\nInner elements\n--------------\n\nThe `DigitalClock` element can contain the following inner elements:\n\n`TimeText`\n\nA collection of formatted strings to show the hours, minutes, and seconds\nassociated with a current clock time.\n\n`Localization`\n: Provides a hint for the locale to use when rendering the time. More\n information is available in the [`Localization`](/training/wearables/wff/common/localization) reference.\n\nA `DigitalClock` element can contain at most one `Localization` element.\n\n`Variant`\n: Allows for changing attributes of this element when the Wear OS device is in\n ambient mode. More information is available in the [`Variant`](/training/wearables/wff/common/variant/variant) reference.\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Group](/training/wearables/wff/group/group)\n- [PartImage](/training/wearables/wff/group/part/image/part-image)"]]