Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase 如何将Google应用程序脚本中的日期保存到Cloud Firestore中的时间戳?_Firebase_Google Apps Script_Google Cloud Firestore - Fatal编程技术网

Firebase 如何将Google应用程序脚本中的日期保存到Cloud Firestore中的时间戳?

Firebase 如何将Google应用程序脚本中的日期保存到Cloud Firestore中的时间戳?,firebase,google-apps-script,google-cloud-firestore,Firebase,Google Apps Script,Google Cloud Firestore,有人能帮我从谷歌脚本到firestore写一个时间戳吗。当我在google脚本中使用“new Date()”时,它在firestore中存储为空映射。如果我将日期字符串化,它将存储为字符串firestore,但我需要这个属性来存储时间戳 要保存为时间戳,只需确保您的日期实际上是日期,而不是字符串。我使用DATEVALUE将我的String转换为日期,然后让我来处理其余部分。如何从Google应用程序脚本写入Firestore??通过RESTAPI?请共享您的代码。您是否尝试将其保存在JavaS

有人能帮我从谷歌脚本到firestore写一个时间戳吗。当我在google脚本中使用“new Date()”时,它在firestore中存储为空映射。如果我将日期字符串化,它将存储为字符串firestore,但我需要这个属性来存储时间戳


要保存为时间戳,只需确保您的日期实际上是
日期
,而不是
字符串
。我使用
DATEVALUE
将我的
String
转换为日期,然后让我来处理其余部分。

如何从Google应用程序脚本写入Firestore??通过RESTAPI?请共享您的代码。您是否尝试将其保存在JavaScript对象中?i、 e.var timeObj={};timeObj.timeStmp=新日期()@保存在JavaScript对象中的Stykes也不起作用。请参见上面的屏幕截图–您能在@AbdurraheemAbdulhakeem解决您的问题吗?如果是,请分享解决方案