android - 恢复 1970 年的 Google Fit 数据
问题描述
我正在编写一个小型应用程序,我需要在其中检索自 Google Fit 时间起源以来用户可能记录的所有数据,我试图以秒 (-3600) 为单位传递 1970 年 1 月 1 日的 unix 时间,但我得到一个错误,它是一个无效的日期。
我当前的代码:
val endTime = getCurrentTime()
val startTime = -3600
val readRequest = DataReadRequest.Builder()
.aggregate(DataType.AGGREGATE_STEP_COUNT_DELTA)
.bucketByTime(1, TimeUnit.DAYS)
.setTimeRange(startTime, endTime,TimeUnit.SECONDS)
.build()
谁能帮我?谢谢。
解决方案
推荐阅读
- c# - 构建 Azure Function v3 时无法解析程序集“Microsoft.AspNetCore.Mvc.Core,版本=3.1.0.0”
- python - Python VS Code 产生过多的输出
- python - 修改现有 Pytorch 代码以在多个 GPU 上运行
- solr - Solr:在文章上运行 TF-IDF 并获取过滤后的内容
- python-3.x - 从列表中填充数据
- java - 类 java.util.ArrayList 不能转换为类 org.springframework.util.MultiValueMap
- python - 当我手动单击链接时,Python 和 Selenium 会弹出一个对话框,而不是自动下载
- .net-core - tweetinvi RegisterWebhookAsync 401 - 未经授权 - 身份验证凭据丢失或不正确
- javascript - 是否可以使用 java/spring boot 关闭浏览器的当前选项卡
- java - Spring Security httpBasic 404 以获得正确的凭据