skip to Main Content

Firebase – Convert milliseconds to Firestore date

In Flutter I convert dates to milliseconds like this: static DateTime createDateTimeNow() { return DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, 0, 0, 0, 0, 0); } // This create a number value like 1660341600000 final Number millisecondsNow = Helpers.createDateTimeNow().toUtc().millisecondsSinceEpoch; // I can also…

VIEW QUESTION

Firebase – How to stream data to the Browser with Google Cloud Functions so that download starts immediately?

I am streaming data to the browser like this: res.writeHead(200, { 'Content-Type': 'text/event-stream', 'Content-Disposition': 'attachment; filename="data.dat"', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive' }) stream1.pipe(res, {end: false)}; stream1.on('end', () => { console.log("stream 1 finished"); stream2.pipe(res, {end: false}); stream2.on('end', () => { console.log("last stream…

VIEW QUESTION
Back To Top
Search