Firebase: Get current time without writing to the database (IOS and ANDROID)Get Firestore Server Time and convert to DateTime without set/update data?How to save the current date/time when I add new value to Firebase Realtime DatabaseShip an application with a databaseHow can I connect to Android with ADB over TCP?“Conversion to Dalvik format failed with error 1” on external JARDownload a file with Android, and showing the progress in a ProgressDialogWhat is the simplest and most robust way to get the user's current location on Android?Get current time and date on Android“cannot resolve symbol R” in Android StudioHow can I send a Firebase Cloud Messaging notification without use the Firebase Console?What's the difference between Cloud Firestore and the Firebase Realtime Database?Android : Get current date and time from firebase
Pros and cons of writing a book review?
Is it OK to bring delicacies from hometown as tokens of gratitude for an out-of-town interview?
Is the decompression of compressed and encrypted data without decryption also theoretically impossible?
Avoiding cliches when writing gods
Is it a problem that pull requests are approved without any comments
Opposite of "Squeaky wheel gets the grease"
Linux tr to convert vertical text to horizontal
Count down from 0 to 5 seconds and repeat
I wrote a scene that the majority of my readers loved. How do I get back to that place while writing my new book?
Building a road to escape Earth's gravity by making a pyramid on Antartica
How to connect an offset point symbol to its original position in QGIS?
Short story written from alien perspective with this line: "It's too bright to look at, so they don't"
Applicants clearly not having the skills they advertise
Personalization conditions switching doesn`t work in Experience Editor (9.1.0, Initial Release)
What happened to all the nuclear material being smuggled after the fall of the USSR?
Does resistor placement change power dissipation in simple LED circuit?
Why does a helium balloon rise?
Will TSA allow me to carry a Continuous Positive Airway Pressure (CPAP) device?
Can we use the verb "says" for advertisement?
Is there any word or phrase for negative bearing?
How bad would a partial hash leak be, realistically?
How were concentration and extermination camp guards recruited?
Working in the USA for living expenses only; allowed on VWP?
X-shaped crossword
Firebase: Get current time without writing to the database (IOS and ANDROID)
Get Firestore Server Time and convert to DateTime without set/update data?How to save the current date/time when I add new value to Firebase Realtime DatabaseShip an application with a databaseHow can I connect to Android with ADB over TCP?“Conversion to Dalvik format failed with error 1” on external JARDownload a file with Android, and showing the progress in a ProgressDialogWhat is the simplest and most robust way to get the user's current location on Android?Get current time and date on Android“cannot resolve symbol R” in Android StudioHow can I send a Firebase Cloud Messaging notification without use the Firebase Console?What's the difference between Cloud Firestore and the Firebase Realtime Database?Android : Get current date and time from firebase
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I want to use Firebase to get the current time on server without writing to the database and then reading it.
Any one knows a solution to directly get a current time stamp from Firebase?
android ios firebase firebase-realtime-database timestamp
add a comment |
I want to use Firebase to get the current time on server without writing to the database and then reading it.
Any one knows a solution to directly get a current time stamp from Firebase?
android ios firebase firebase-realtime-database timestamp
add a comment |
I want to use Firebase to get the current time on server without writing to the database and then reading it.
Any one knows a solution to directly get a current time stamp from Firebase?
android ios firebase firebase-realtime-database timestamp
I want to use Firebase to get the current time on server without writing to the database and then reading it.
Any one knows a solution to directly get a current time stamp from Firebase?
android ios firebase firebase-realtime-database timestamp
android ios firebase firebase-realtime-database timestamp
edited Jul 26 '18 at 13:39
Alex Mamo
50.4k83169
50.4k83169
asked Jul 26 '18 at 13:24
datadata
1567
1567
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Yes there is! It doesn't matter if it is for IOS or for Android, you can write a frunction in Cloud Functions for Firebase which will be as easy as:
exports.currentTime = functions.https.onRequest((req, res) =>
res.send("timestamp":new Date().getTime())
)
You can host this in Cloud Function and get the server timestamp without user interaction.
For more informations on how to set/read a timestamp in a Firebase Real-time database, please see my answer from this post.
Thanks for your answer, but how to get this value from the client (lets say for android)?
– data
Jul 26 '18 at 17:17
In the exact same way I have explained in this post, right? Use thegetTimeDate()
method and that's it.
– Alex Mamo
Jul 26 '18 at 17:20
I mean when I deploy my function, how would this function give me the time?
– data
Jul 26 '18 at 17:23
How is this function triggered and how would it return the current time to my app?
– data
Jul 26 '18 at 17:25
You need to host in Coud Function and then trigger like any other function. Use cron-job.org for example, right?
– Alex Mamo
Jul 26 '18 at 17:34
|
show 10 more comments
You have to write a firebase cloud function that calculates the time. Deploy that function on firebase. Whenever you request that function it will gives you the current time.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51539997%2ffirebase-get-current-time-without-writing-to-the-database-ios-and-android%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Yes there is! It doesn't matter if it is for IOS or for Android, you can write a frunction in Cloud Functions for Firebase which will be as easy as:
exports.currentTime = functions.https.onRequest((req, res) =>
res.send("timestamp":new Date().getTime())
)
You can host this in Cloud Function and get the server timestamp without user interaction.
For more informations on how to set/read a timestamp in a Firebase Real-time database, please see my answer from this post.
Thanks for your answer, but how to get this value from the client (lets say for android)?
– data
Jul 26 '18 at 17:17
In the exact same way I have explained in this post, right? Use thegetTimeDate()
method and that's it.
– Alex Mamo
Jul 26 '18 at 17:20
I mean when I deploy my function, how would this function give me the time?
– data
Jul 26 '18 at 17:23
How is this function triggered and how would it return the current time to my app?
– data
Jul 26 '18 at 17:25
You need to host in Coud Function and then trigger like any other function. Use cron-job.org for example, right?
– Alex Mamo
Jul 26 '18 at 17:34
|
show 10 more comments
Yes there is! It doesn't matter if it is for IOS or for Android, you can write a frunction in Cloud Functions for Firebase which will be as easy as:
exports.currentTime = functions.https.onRequest((req, res) =>
res.send("timestamp":new Date().getTime())
)
You can host this in Cloud Function and get the server timestamp without user interaction.
For more informations on how to set/read a timestamp in a Firebase Real-time database, please see my answer from this post.
Thanks for your answer, but how to get this value from the client (lets say for android)?
– data
Jul 26 '18 at 17:17
In the exact same way I have explained in this post, right? Use thegetTimeDate()
method and that's it.
– Alex Mamo
Jul 26 '18 at 17:20
I mean when I deploy my function, how would this function give me the time?
– data
Jul 26 '18 at 17:23
How is this function triggered and how would it return the current time to my app?
– data
Jul 26 '18 at 17:25
You need to host in Coud Function and then trigger like any other function. Use cron-job.org for example, right?
– Alex Mamo
Jul 26 '18 at 17:34
|
show 10 more comments
Yes there is! It doesn't matter if it is for IOS or for Android, you can write a frunction in Cloud Functions for Firebase which will be as easy as:
exports.currentTime = functions.https.onRequest((req, res) =>
res.send("timestamp":new Date().getTime())
)
You can host this in Cloud Function and get the server timestamp without user interaction.
For more informations on how to set/read a timestamp in a Firebase Real-time database, please see my answer from this post.
Yes there is! It doesn't matter if it is for IOS or for Android, you can write a frunction in Cloud Functions for Firebase which will be as easy as:
exports.currentTime = functions.https.onRequest((req, res) =>
res.send("timestamp":new Date().getTime())
)
You can host this in Cloud Function and get the server timestamp without user interaction.
For more informations on how to set/read a timestamp in a Firebase Real-time database, please see my answer from this post.
answered Jul 26 '18 at 13:36
Alex MamoAlex Mamo
50.4k83169
50.4k83169
Thanks for your answer, but how to get this value from the client (lets say for android)?
– data
Jul 26 '18 at 17:17
In the exact same way I have explained in this post, right? Use thegetTimeDate()
method and that's it.
– Alex Mamo
Jul 26 '18 at 17:20
I mean when I deploy my function, how would this function give me the time?
– data
Jul 26 '18 at 17:23
How is this function triggered and how would it return the current time to my app?
– data
Jul 26 '18 at 17:25
You need to host in Coud Function and then trigger like any other function. Use cron-job.org for example, right?
– Alex Mamo
Jul 26 '18 at 17:34
|
show 10 more comments
Thanks for your answer, but how to get this value from the client (lets say for android)?
– data
Jul 26 '18 at 17:17
In the exact same way I have explained in this post, right? Use thegetTimeDate()
method and that's it.
– Alex Mamo
Jul 26 '18 at 17:20
I mean when I deploy my function, how would this function give me the time?
– data
Jul 26 '18 at 17:23
How is this function triggered and how would it return the current time to my app?
– data
Jul 26 '18 at 17:25
You need to host in Coud Function and then trigger like any other function. Use cron-job.org for example, right?
– Alex Mamo
Jul 26 '18 at 17:34
Thanks for your answer, but how to get this value from the client (lets say for android)?
– data
Jul 26 '18 at 17:17
Thanks for your answer, but how to get this value from the client (lets say for android)?
– data
Jul 26 '18 at 17:17
In the exact same way I have explained in this post, right? Use the
getTimeDate()
method and that's it.– Alex Mamo
Jul 26 '18 at 17:20
In the exact same way I have explained in this post, right? Use the
getTimeDate()
method and that's it.– Alex Mamo
Jul 26 '18 at 17:20
I mean when I deploy my function, how would this function give me the time?
– data
Jul 26 '18 at 17:23
I mean when I deploy my function, how would this function give me the time?
– data
Jul 26 '18 at 17:23
How is this function triggered and how would it return the current time to my app?
– data
Jul 26 '18 at 17:25
How is this function triggered and how would it return the current time to my app?
– data
Jul 26 '18 at 17:25
You need to host in Coud Function and then trigger like any other function. Use cron-job.org for example, right?
– Alex Mamo
Jul 26 '18 at 17:34
You need to host in Coud Function and then trigger like any other function. Use cron-job.org for example, right?
– Alex Mamo
Jul 26 '18 at 17:34
|
show 10 more comments
You have to write a firebase cloud function that calculates the time. Deploy that function on firebase. Whenever you request that function it will gives you the current time.
add a comment |
You have to write a firebase cloud function that calculates the time. Deploy that function on firebase. Whenever you request that function it will gives you the current time.
add a comment |
You have to write a firebase cloud function that calculates the time. Deploy that function on firebase. Whenever you request that function it will gives you the current time.
You have to write a firebase cloud function that calculates the time. Deploy that function on firebase. Whenever you request that function it will gives you the current time.
answered Jul 26 '18 at 13:31
RajRaj
2,4912520
2,4912520
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51539997%2ffirebase-get-current-time-without-writing-to-the-database-ios-and-android%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown