首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在虚拟磁带库的putItem中添加当前日期

如何在虚拟磁带库的putItem中添加当前日期
EN

Stack Overflow用户
提问于 2018-12-05 13:38:06
回答 1查看 587关注 0票数 1
代码语言:javascript
复制
{
  "version": "2017-02-28",
  "operation": "PutItem",
  "key": {
    "id": $util.dynamodb.toDynamoDBJson($util.autoId()),
    "createdDate":$core_v2_utility.CurrentDate
  },
  "attributeValues": $util.dynamodb.toMapValuesJson($ctx.args.input),
  "condition": {
    "expression": "attribute_not_exists(#id)",
    "expressionNames": {
      "#id": "id",
      "#createdDate":"createdDate",
    },
   },
}

我一直在尝试使用VTL.I将createDate添加到DynamoDB中。我正在使用$core_v2_utility.CurrentDate查找错误

EN

回答 1

Stack Overflow用户

发布于 2018-12-06 14:17:02

亚马逊网络服务AppSync没有$core_v2_utility.CurrentDate。你是想用协调世界时吗?$util.time.nowFormatted("yyyy-MM-dd HH:mm:ssZ")给你的是协调世界时的当前日期和时间。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53625805

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档