FirebaseDatabase Framework Reference Stay organized with collections Save and categorize content based on your preferences.
Structures
The following structures are available globally.
A property wrapper that marks an
Optional<Date>field to bepopulated with a server timestamp. If aCodableobject being writtencontains anilfor an@ServerTimestamp-annotated field, it will bereplaced withServerValue.timestamp()as it is sent.Example:
structCustomModel{@ServerTimestampvarts:Date?}Then writing
CustomModel(ts: nil)will tell server to filltswithcurrent timestamp.Declaration
Swift
@propertyWrapperpublicstructServerTimestamp:Codable,Equatable,Hashable
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-11 UTC.