I'm pretty much new to Firebase Cloud Functions, so I don't know whether the question I'm going to ask is valid/not.
So basically I'm working on an android fantasy game (which uses firebase database) which has several contests to be started and ended based on the contest's date and time validity. So I want to get the current date and time so that I can calculate the time remaining to participate in the contest and save that in the database (using CLoud functions)
So to get the current time, should I use APIs like 'https://timezonedb.com/api' or is there anything else I can do to get the time.
Also, how can I calculate the remaining time given the deadline and the current time (in TypeScript language)?
I went through a lot of videos and docs, but couldn't figure out any approach. A short explanation and some useful links would be of great help.