TextClock

Example:

                                    
                                        <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".TextClockExample"
    android:padding="16dp"
    android:orientation="vertical"
    android:gravity="center">

    <TextClock
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="@color/colorWhite"
        android:textStyle="bold"
        android:textSize="40sp"
        android:format12Hour="hh:mm:ss a"
        android:gravity="center"
        android:background="@color/colorOrange"
    />

</LinearLayout>

                                    
                                  

Output