Stay organized with collections
Save and categorize content based on your preferences.
Variables
TIMESTAMP
TIMESTAMP: Object
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-07-27 UTC.
[null,null,["Last updated 2022-07-27 UTC."],[],[],null,["- [firebase](/docs/reference/node/firebase).\n- [database](/docs/reference/node/firebase.database).\n- ServerValue \n\nIndex\n\nVariables\n\n- [TIMESTAMP](/docs/reference/node/firebase.database.ServerValue#timestamp)\n\nFunctions\n\n- [increment](/docs/reference/node/firebase.database.ServerValue#increment)\n\nVariables\n\nTIMESTAMP \nTIMESTAMP: Object \nA placeholder value for auto-populating the current timestamp (time\nsince the Unix epoch, in milliseconds) as determined by the Firebase\nservers.\n\nexample\n:\n\n var sessionsRef = firebase.database().ref(\"sessions\");\n sessionsRef.push({\n startedAt: firebase.database.ServerValue.TIMESTAMP\n });\n\n\nFunctions\n\nincrement\n\n- increment ( delta : number ) : Object\n- Returns a placeholder value that can be used to atomically increment the\n current database value by the provided delta.\n\n Parameters\n -\n\n delta: number \n the amount to modify the current value atomically.\n\n Returns Object\n\na placeholder value for modifying data atomically server-side."]]
A placeholder value for auto-populating the current timestamp (time since the Unix epoch, in milliseconds) as determined by the Firebase servers.
var sessionsRef = firebase.database().ref("sessions"); sessionsRef.push({ startedAt: firebase.database.ServerValue.TIMESTAMP });