i am working on a app that sends some specific data to users using firebase.
i want that when i change data in firebase there should be a timestamp in the app which shows when the last data was updated.
so that user can see when was the last update happen.
i tried my all to do it by myself but i failed.
please help guys.
sorry for my bad english.
Welcome. Can you change your title to lowercase. All uppercase is like shouting and we don’t shout here.
Can you show what you tried?
hello sir. i am sorry because i am at my home and don’t have pc here.
but i can explain what o tried: -
i used “format date time” function from clock component and called it under “when firebase data change” function where i am getting my tags value. i disabled timer from its properties and enabled it with blocks under “when data change” function of firebase. but when i close and re-open the screen time automatically sets to the current time.
With what you explained
You are telling Your App to save The time and date to firebase Not Display to App
Let see your block for clerification
you have to use a tinydb and store date when user send data to firebase, or store you time also to firebase and when user came back get that time value.
sir i am only using firebase to send data. i am not storing any data to firebase.
i will be the only who can send data to my app. user can only read the data.
let me explain about my app :- i am working on a share market app where i will send signals to buy or sell a share and will also provide share current price.
i will update signal few time in a day so i want a time stamp so that user can see when was the last update happened. i want to print time stamp on a label when i change data in firebase.
i tried but time automatically changes when i close and reopen the screen.
i am attaching a screenshot of my block.
you are just showing it in a label, not saving it to any storage like tinydb or firebase, how it will get saved, when app starts it must be loaded from some where? use tinydb and store it to that. and when app start again get that value from tinydb
thank you very much sir for replying.
your code is working fine and i also want the same but i am not using any button. i want to print time when i change a firebase tag value. suppose the tag is “result”(please refer to my block image).
when ever i change “result tag” value, what was the time when changes were made should be print.
you can use it where you have used update time text, there with that you can use this block store value, and if you are storing data in some other app or direct on firebase website then you can store a tag with time and store time there manually, because when your app is not opened then data changed block will not work and you cant store date
could you please explain me with blocks . i am noob.
something like this