openharmony 鸿蒙 changelogs-time

2023-10-30 浏览 (241)

Time Subsystem Changelog

cl.time.1 Permission Verification Adding for setTime, setDate, and setTimezone

Added permission verification for the setTime, setDate, and setTimezone APIs for compliance with the OpenHarmony API specifications.

Specifically:

  • To call the setTime API, the ohos.permission.SET_TIME permission is required.
  • To call the setDate API, the ohos.permission.SET_TIME permission is required.
  • To call the setTimezone API, the ohos.permission.SET_TIME_ZONE permission is required.

Key API/Component Changes

Involved APIs:

  • systemDateTime.setTime;
  • systemDateTime.setDate;
  • systemDateTime.setTimezone;

Before change:

  • No permission is required for calling the APIs in question.

After change:

  • The APIs can be called only after the specific permission is obtained. If the permission request is invalid or the specific permission is not obtained, 201 is returned, indicating that permission verification fails.

Adaptation Guide

To call the setTime, setDate, and setTimezone APIs, an application must apply for the corresponding permission.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkUI Subsystem Changelog

harmony 鸿蒙Bundle Management Subsystem Changelog

harmony 鸿蒙Multimedia Subsystem Changelog

harmony 鸿蒙Network Management Subsystem Changelog

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/6c577090a3b2448aacbcd4e1baeb5a8f