Stay organized with collections
Save and categorize content based on your preferences.
@Documented
@Retention(value = RetentionPolicy.CLASS)
@Target(value = [ElementType.FIELD, ElementType.METHOD])
public annotation Document.CreationTimestampMillis
Marks a member field of a document as the document's creation timestamp.
The creation timestamp is used for document expiry (see TtlMillis
) and as one of the sort options for queries.
This field is not required. If not present or not set, the document will be assigned the current timestamp as its creation timestamp.
If present, the field must be of type long
or Long
.
See the class description of Document
for other requirements (i.e. if present it must be visible, or have a visible getter and setter, or be exposed through a visible constructor).
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-07-17 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-07-17 UTC."],[],[],null,["# Document.CreationTimestampMillis\n================================\n\nArtifact: [androidx.appsearch:appsearch](/jetpack/androidx/releases/appsearch) \n[View Source](https://cs.android.com/search?q=file:androidx/appsearch/annotation/Document.java+class:androidx.appsearch.annotation.Document.CreationTimestampMillis) \nAdded in [1.1.0](/jetpack/androidx/releases/appsearch#1.1.0)\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/androidx/appsearch/annotation/Document.CreationTimestampMillis \"View this page in Kotlin\") \\|Java\n\n\n```\n@Documented\n@Retention(value = RetentionPolicy.CLASS)\n@Target(value = [ElementType.FIELD, ElementType.METHOD])\npublic annotation Document.CreationTimestampMillis\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nMarks a member field of a document as the document's creation timestamp.\n\nThe creation timestamp is used for document expiry (see [TtlMillis](/reference/androidx/appsearch/annotation/Document.TtlMillis)) and as one of the sort options for queries.\n\nThis field is not required. If not present or not set, the document will be assigned the current timestamp as its creation timestamp.\n\nIf present, the field must be of type `long` or [Long](https://developer.android.com/reference/java/lang/Long.html).\n\nSee the class description of [Document](/reference/androidx/appsearch/annotation/Document) for other requirements (i.e. if present it must be visible, or have a visible getter and setter, or be exposed through a visible constructor)."]]