FirebaseDatabase Framework Reference

Structures

The following structures are available globally.

  • A property wrapper that marks anOptional<Date> field to bepopulated with a server timestamp. If aCodable object being writtencontains anil for an@ServerTimestamp-annotated field, it will bereplaced withServerValue.timestamp() as it is sent.

    Example:

    structCustomModel{@ServerTimestampvarts:Date?}

    Then writingCustomModel(ts: nil) will tell server to fillts withcurrent 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.