当前位置: 首页 > news >正文

HarmonyOS:时间日期国际化

一、使用场景

在不同的国家和文化中,时间和日期格式的表示方法有所不同,使用惯例的不同点包括:日期中年月日的顺序、时间中时分秒的分隔符等。若应用中需展示时间日期,要确保界面以合适的方式显示,以便用户能够理解。

时间日期国际化包括时间日期格式化、相对时间格式化、时间段格式化。时间日期格式化是指将时间和日期转换为指定格式的字符串。相对时间格式化是指将一个时间点与另一个时间点之间的时间差转换为指定格式,时间差如“30秒前”、“1天后”。时间段格式化是指将一段时间转换为指定格式,时间段如“星期三”、“8:00–11:30”。

二、约束与限制

日期格式和时间格式需同时设置。若设置了时间格式,未设置日期格式,只显示时间格式;若设置了日期格式,未设置时间格式,只显示日期格式。

若设置了时间或日期格式,则不支持设置年、月、日、时、分、秒、工作日格式;不设置时间或日期格式时,支持独立设置年、月、日、时、分、秒、工作日格式。

三、开发步骤

3.1 时间日期和相对时间格式化

时间日期格式化将表示时间日期的Date对象,通过DateTimeFormat类的format接口实现格式化,具体开发步骤如下。

3.1.1 导入模块
import { intl } from '@kit.LocalizationKit';
3.1.2 创建DateTimeFormat对象

传入单独的locale参数或locale列表,若传入列表使用第一个有效的locale创建对象。不传入locale参数时,使用系统当前的locale创建对象。

构造函数支持通过DateTimeOptions设置不同的时间日期格式,具体请参考表1-表6。

let dateFormat: intl.DateTimeFormat = new intl.DateTimeFormat(locale: string | Array<string>, options?: DateTimeOptions);
let dateFormat: intl.DateTimeFormat = new intl.DateTimeFormat(); //不传入locale参数
3.1.3 时间日期和相对时间格式化
// 时间日期格式化
let formattedDate: string = dateFormat.format(date: Date);// 相对时间格式化
let formattedDateRange: string = dateFormat.formatRange(startDate: Date, endDate: Date);
3.1.4 获取格式化选项,查看对象的设置信息
let options: intl.DateTimeOptions = dateFormat.resolvedOptions();
3.2 时间日期格式化选项

以时间:2021年9月17日 13:04:00,locale: zh-CN为例,说明DateTimeOptions不同的取值和显示结果。

表1 日期显示格式(dateStyle)

取值显示结果
full2021年9月17日星期五
long2021年9月17日
short2021/9/17
medium2021年9月17日

表2 时间显示格式(timeStyle)

取值显示效果
full中国标准时间 13:04:00
longGMT+8 13:4:00
short13:04
medium13:04:00

表3 年份显示格式(year)

取值显示效果
numeric2021
2-digit21

表4 工作日显示格式(weekday)

取值显示效果
long星期五
short周五
narrow

表5 时制格式(hourCycle)

取值显示效果
h11下午13:04
h12下午1:04
h231:04
h2413:04
3.3 开发实例

效果图

在这里插入图片描述

TestDateTimeFormat.ets代码

import { intl } from '@kit.LocalizationKit';
import { systemDateTime } from '@kit.BasicServicesKit'/*
时间日期和相对时间格式化
时间日期格式化将表示时间日期的Date对象,通过DateTimeFormat类的format接口实现格式化*/let dateFormat: intl.DateTimeFormat = new intl.DateTimeFormat(); //不传入locale参数
let currentDate = new Date();
let formattedDate = dateFormat.format(currentDate)
console.log(`格式化 日期 Date对象 formattedDate:${formattedDate}`)
let time = systemDateTime.getTime(false)
let formattedTimeDate = dateFormat.format(new Date(time))
console.log(`格式化 日期Date对象带有时间戳参数  formattedTimeDate:${formattedTimeDate}`)let date = new Date(2021, 8, 17, 13, 4, 0); // 时间日期为2021.09.17 13:04:00
let startDate = new Date(2021, 8, 17, 13, 4, 0);
let endDate = new Date(2021, 8, 18, 13, 4, 0);// 在软件上展示完整的时间信息
let dateFormat1 = new intl.DateTimeFormat('zh-CN', { dateStyle: 'full', timeStyle: 'full' });
let formattedDate1 = dateFormat1.format(date); // formattedDate1: 2021年9月17日星期五 中国标准时间 13:04:00
console.log(`在软件上展示完整的时间信息 formattedDate1:${formattedDate1}`)
// 在有限的空间展示简短的时间信息
let dateFormat2 = new intl.DateTimeFormat('zh-CN', { dateStyle: 'short', timeStyle: 'short' });
let formattedDate2 = dateFormat2.format(date); // formattedDate2: 2021/9/17 13:04
console.log(`在有限的空间展示简短的时间信息 formattedDate2:${formattedDate2}`)// 自定义年月日时分秒的显示效果
let dateFormat3 = new intl.DateTimeFormat('zh-CN', {year: 'numeric',month: '2-digit',day: '2-digit',hour: '2-digit',minute: '2-digit',second: '2-digit'
});
let formattedDate3 = dateFormat3.format(date); // formattedDate3: 2021/09/17 13:04:00
console.log(`自定义年月日时分秒的显示效果 formattedDate3:${formattedDate3}`)// 仅显示一部分时间
let dateFormat4 = new intl.DateTimeFormat('zh-CN', { month: 'long', day: 'numeric', weekday: 'long' });
let formattedDate4 = dateFormat4.format(date); // formattedDate4: 9月17日星期五
console.log(`仅显示一部分时间 formattedDate4:${formattedDate4}`)// 自定义时制格式
let dateFormat5 = new intl.DateTimeFormat('zh-CN', { dateStyle: 'short', timeStyle: 'short', hourCycle: 'h11' });
let formattedDate5 = dateFormat5.format(date); // formattedDate5: 2021/9/17 下午13:04
console.log(`自定义时制格式 formattedDate5:${formattedDate5}`)// 面向习惯于其他数字系统的用户
let dateFormat6 = new intl.DateTimeFormat('zh-CN', { dateStyle: 'short', timeStyle: 'short', numberingSystem: 'arab' });
let formattedDate6 = dateFormat6.format(date); // formattedDate6: ٢٠٢١/٩/١٧ ١٣:٠٤
console.log(`面向习惯于其他数字系统的用户 formattedDate6:${formattedDate6}`)// 格式化时间段
let dataFormat7 = new intl.DateTimeFormat('en-GB');
let formattedDateRange = dataFormat7.formatRange(startDate, endDate); // formattedDateRange: 17/09/2021 - 18/09/2021
console.log(`格式化时间段 formattedDateRange:${formattedDateRange}`)// 获取格式化选项
let dataFormat8 = new intl.DateTimeFormat('en-GB', { dateStyle: 'full' });
let options = dataFormat8.resolvedOptions();
let dateStyle = options.dateStyle; // dateStyle: full
console.log(`获取格式化选项 dateStyle:${dateStyle}`)// 自定义年月日时分秒的显示效果
let dateFormat8 = new intl.DateTimeFormat('zh-CN', {year: 'numeric',month: '2-digit',day: '2-digit',hour: '2-digit',minute: '2-digit',second: '2-digit'
})let formattedDate8 = dateFormat8.format(currentDate); // 2025/02/08 10:13:17
formattedDate8 = formattedDate8.replaceAll('/', ".");// 2025.02.08 10:23:56
console.log(`自定义年月日时分秒的显示效果2 formattedDate8:${formattedDate8}`)let dateFormat9 = new intl.DateTimeFormat('zh-CN', {dateStyle: 'medium',timeStyle: 'short'
})let formattedDate9 = dateFormat9.format(currentDate); //2025年2月8日 上午10:30
console.log(`自定义年月日时分秒的显示效果3 formattedDate9:${formattedDate9}`)let dateFormat10 = new intl.DateTimeFormat('zh-CN', {dateStyle: 'medium',timeStyle: 'medium',hourCycle: 'h23'
})let formattedDate10 = dateFormat10.format(currentDate); //2025年2月8日 10:30:16
console.log(`自定义年月日时分秒的显示效果4 formattedDate10:${formattedDate10}`)@Entry
@Component
struct TestDateTimeFormat {@State message: string = '时间日期国际化';build() {Scroll() {Column({ space: 16 }) {Text(this.message).id('TestDateTimeFormatHelloWorld').fontSize(20).fontWeight(FontWeight.Bold)Text(`formattedDate:${formattedDate}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`formattedTimeDate:${formattedTimeDate}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`在软件上展示完整的时间信息:${formattedDate1}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`在有限的空间展示简短的时间信息:${formattedDate2}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`自定义年月日时分秒的显示效果:${formattedDate3}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`自定义年月日时分秒的显示效果2:${formattedDate8}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`自定义年月日时分秒的显示效果3:${formattedDate9}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`仅显示一部分时间:${formattedDate4}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`自定义时制格式:${formattedDate5}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`面向习惯于其他数字系统的用户:${formattedDate6}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`格式化时间段:${formattedDateRange}`).fontSize(20).fontWeight(FontWeight.Medium)}}.height('100%').width('100%')}
}

四、相对时间格式化

格式化相对时间将表示时间日期的Date对象,通过RelativeTimeFormat类的format接口实现格式化,具体开发步骤如下。

4.1 导入模块
import { intl } from '@kit.LocalizationKit';
4.2 创建RelativeTimeFormat对象

构造函数支持通过RelativeTimeFormatInputOptions设置不同的输出消息格式和国际化消息长度,具体请参考表6-表7。

let relativeTimeFormat: intl.RelativeTimeFormat = new intl.RelativeTimeFormat(locale: string | Array<string>, options?: RelativeTimeFormatInputOptions);
4.3 格式化相对时间。value为格式化的数值,unit为格式化的单位
let formattedRelativeTime: string = relativeTimeFormat.format(value: number, unit: string);
4.4 自定义相对时间的格式化
let parts: Array<object> = relativeTimeFormat.formatToParts(value: number, unit: string);
4.5 获取相对时间格式化选项,查看对象的设置信息
let options: intl.RelativeTimeFormatInputOptions = relativeTimeFormat.resolvedOptions();
4.6 相对时间格式化选项

以相对时间:一天前,locale: fr-FR和en-GB为例,说明RelativeTimeFormatInputOptions不同的取值和显示结果。

表6 输出消息格式(numeric)

取值显示效果(fr-FR)显示效果(en-GB)
alwaysil y a 1 jour1 day ago
autohieryesterday

表7 国际化消息长度(style)

取值显示效果(fr-FR)显示效果(en-GB)
longil y a 1 jour1 day ago
shortil y a 1 j1 day ago
narrow-1 j1 day ago
4.7 开发实例

效果图

在这里插入图片描述

TestRelativeTimeFormat.ets代码

// 显示相对时间
let relativeTimeFormat1 = new intl.RelativeTimeFormat('en-GB');
let formattedRelativeTime1 = relativeTimeFormat1.format(-1, 'day'); // formattedRelativeTime1: 1 day ago
console.log(`显示相对时间 formattedRelativeTime1:${formattedRelativeTime1}`)// 口语化
let relativeTimeFormat2 = new intl.RelativeTimeFormat('en-GB', { numeric: "auto" });
let formattedRelativeTime2 = relativeTimeFormat2.format(-1, 'day'); // formattedRelativeTime2: yesterday
console.log(`口语化 formattedRelativeTime2:${formattedRelativeTime2}`)// 部分语言支持更为简短的显示风格
let relativeTimeFormat3 = new intl.RelativeTimeFormat('fr-FR'); // 默认style为long
let formattedRelativeTime3 = relativeTimeFormat3.format(-1, 'day'); // formattedRelativeTime3: il y a 1 jour
console.log(`部分语言支持更为简短的显示风格1 formattedRelativeTime3:${formattedRelativeTime3}`)let relativeTimeFormat4 = new intl.RelativeTimeFormat('fr-FR', { style: 'narrow' });
let formattedRelativeTime4 = relativeTimeFormat4.format(-1, 'day'); // formattedRelativeTime4: -1 j
console.log(`部分语言支持更为简短的显示风格2 formattedRelativeTime4:${formattedRelativeTime4}`)// 自定义区域设置格式的相对时间格式
let relativeTimeFormat5 = new intl.RelativeTimeFormat('en-GB', { style: 'long' });
// parts: [{type: 'literal', value: 'in'}, {type: 'integer', value: 1, unit: 'day'}, {type: 'literal', value: 'day'}]
let parts = relativeTimeFormat5.formatToParts(1, 'day');
console.log(`自定义区域设置格式的相对时间格式 parts:${parts}`)// 获取RelativeTimeFormat对象的格式化选项
let relativeTimeFormat6 = new intl.RelativeTimeFormat('en-GB', { numeric: 'auto' });
let options = relativeTimeFormat6.resolvedOptions();
let numeric = options.numeric; // numeric: auto
console.log(`获取RelativeTimeFormat对象的格式化选项 numeric:${numeric}`)@Entry
@Component
struct TestRelativeTimeFormat {@State message: string = '相对时间格式化';build() {Scroll() {Column({ space: 16 }) {Text(this.message).id('TestRelativeTimeFormatHelloWorld').fontSize(20).fontWeight(FontWeight.Bold)Text(`显示相对时间:${formattedRelativeTime1}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`口语化:${formattedRelativeTime2}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`部分语言支持更为简短的显示风格1:${formattedRelativeTime3}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`部分语言支持更为简短的显示风格2:${formattedRelativeTime4}`).fontSize(20).fontWeight(FontWeight.Medium)Text(`自定义区域设置格式的相对时间格式:${parts}`).fontSize(20).fontWeight(FontWeight.Medium)}}.height('100%').width('100%')}
}

相关文章:

HarmonyOS:时间日期国际化

一、使用场景 在不同的国家和文化中&#xff0c;时间和日期格式的表示方法有所不同&#xff0c;使用惯例的不同点包括&#xff1a;日期中年月日的顺序、时间中时分秒的分隔符等。若应用中需展示时间日期&#xff0c;要确保界面以合适的方式显示&#xff0c;以便用户能够理解。 …...

使用miniforge代替miniconda

conda作为Python数据科学领域的常用软件&#xff0c;是对Python环境及相关依赖进行管理的经典工具&#xff0c;通常集成在anaconda或miniconda等产品中供用户日常使用。 但长久以来&#xff0c;conda在很多场景下运行缓慢卡顿、库解析速度过慢等问题也一直被用户所诟病&#xf…...

LIMO:少即是多的推理

25年2月来自上海交大、SII 和 GAIR 的论文“LIMO: Less is More for Reasoning”。 一个挑战是在大语言模型&#xff08;LLM&#xff09;中的复杂推理。虽然传统观点认为复杂的推理任务需要大量的训练数据&#xff08;通常超过 100,000 个示例&#xff09;&#xff0c;但本文展…...

【玩转 Postman 接口测试与开发2_018】第14章:利用 Postman 初探 API 安全测试

《API Testing and Development with Postman》最新第二版封面 文章目录 第十四章 API 安全测试1 OWASP API 安全清单1.1 相关背景1.2 OWASP API 安全清单1.3 认证与授权1.4 破防的对象级授权&#xff08;Broken object-level authorization&#xff09;1.5 破防的属性级授权&a…...

如何编写测试用例

代码质量管理是软件开发过程中的关键组成部分&#xff0c;比如我们常说的代码规范、代码可读性、单元测试和测试覆盖率等&#xff0c;对于研发人员来说单元测试和测试覆盖率是保障自己所编写代码的质量的重要手段&#xff1b;好的用例可以帮助研发人员确保代码质量和稳定性、减…...

复原IP地址(力扣93)

有了上一道题分割字符串的基础&#xff0c;这道题理解起来就会容易很多。相同的思想我就不再赘述&#xff0c;在这里我就说明一下此题额外需要注意的点。首先是终止条件如何确定&#xff0c;上一题我们递归到超过字符串长度时&#xff0c;则说明字符串已经分割完毕&#xff0c;…...

zzcms接口index.php id参数存在SQL注入漏洞

zzcms接口index.php id参数存在SQL注入漏洞 漏洞描述 ZZCMS 2023中发现了一个严重漏洞。该漏洞影响了文件/index.php中的某些未知功能,操纵参数id会导致SQL注入,攻击可能是远程发起的,该漏洞已被公开披露并可被利用。攻击者可通过sql盲注等手段,获取数据库信息。 威胁等级:…...

Redis03 - 高可用

Redis高可用 文章目录 Redis高可用一&#xff1a;主从复制 & 读写分离1&#xff1a;主从复制的作用2&#xff1a;主从复制原理2.1&#xff1a;全量复制2.2&#xff1a;增量复制&#xff08;环形缓冲区&#xff09; 3&#xff1a;主从复制实际演示3.1&#xff1a;基本流程准…...

系统URL整合系列视频四(需求介绍补充)

视频 系统URL整合系列视频四&#xff08;需求补充说明&#xff09; 视频介绍 &#xff08;全国&#xff09;大型分布式系统Web资源URL整合需求&#xff08;补充&#xff09;讲解。当今社会各行各业对软件系统的web资源访问权限控制越来越严格&#xff0c;控制粒度也越来越细。…...

激活函数篇 03 —— ReLU、LeakyReLU、ELU

本篇文章收录于专栏【机器学习】 以下是激活函数系列的相关的所有内容: 一文搞懂激活函数在神经网络中的关键作用 逻辑回归&#xff1a;Sigmoid函数在分类问题中的应用 整流线性单位函数&#xff08;Rectified Linear Unit, ReLU&#xff09;&#xff0c;又称修正线性单元&a…...

山东大学软件学院人机交互期末复习笔记

文章目录 2022-2023 数媒方向2023-2024 软工方向重点题目绪论发展阶段 感知和认知基础视觉听觉肤觉知觉认知过程和交互设计原则感知和识别注意记忆问题解决语言处理影响认知的因素 立体显示技术及其应用红蓝眼镜偏振式眼镜主动式&#xff08;快门时&#xff09;立体眼镜 交互设…...

python 语音识别方案对比

目录 一、语音识别 二、代码实践 2.1 使用vosk三方库 2.2 使用SpeechRecognition 2.3 使用Whisper 一、语音识别 今天识别了别人做的这个app,觉得虽然是个日记app 但是用来学英语也挺好的,能进行语音识别,然后矫正语法,自己说的时候 ,实在不知道怎么说可以先乱说,然…...

docker常用命令及案例

以下是 Docker 的所有常用命令及其案例说明&#xff0c;按功能分类整理&#xff1a; 1. 镜像管理 1.1 拉取镜像 命令: docker pull <镜像名>:<标签>案例: 拉取官方的 nginx 镜像docker pull nginx:latest1.2 列出本地镜像 命令: docker images案例: 查看本地所有…...

DeepSeek-R1 云环境搭建部署流程

DeepSeek横空出世&#xff0c;在国际AI圈备受关注&#xff0c;作为个人开发者&#xff0c;AI的应用可以有效地提高个人开发效率。除此之外&#xff0c;DeepSeek的思考过程、思考能力是开放的&#xff0c;这对我们对结果调优有很好的帮助效果。 DeepSeek是一个基于人工智能技术…...

Java_双列集合

双列集合特点 存放的是键值对对象&#xff08;Entry&#xff09; Map 因为都是继承Map&#xff0c;所以要学会这些API&#xff0c;后面的类就都知道了 put 有两个操作&#xff0c;添加&#xff08;并返回null&#xff09;或者覆盖&#xff08;返回被覆盖的值&#xff09…...

.net的一些知识点6

1.写个Lazy<T>的单例模式 public class SingleInstance{private static readonly Lazy<SingleInstance> instance new Lazy<SingleInstance>(() > new SingleInstance());private SingleInstance(){}public static SingleInstance Instace > instance…...

无须付费,安装即是完全版!

不知道大家有没有遇到过不小心删掉了电脑上超重要的文件&#xff0c;然后急得像热锅上的蚂蚁&#xff1f; 别担心&#xff0c;今天给大家带来一款超给力的数据恢复软件&#xff0c;简直就是拯救文件的“救星”&#xff01; 数据恢复 专业的恢复数据软件 这款软件的界面设计得特…...

常见数据库对象与视图VIEW

常见的数据库对象 表 TABLE 数据字典 约束 CONSTRAINT 视图 VIEW 索引 INDEX 存储过程 PROCESS 存储函数 FUNCTION 触发器 TRIGGER 视图VIEW 1、引入 为什么使用视图&#xff1f; 视图可以帮助我们使用表的一部分&#xff0c;针对不同的用户制定不同的查询视图。 …...

【Vue2】vue2项目中如何使用mavon-editor编辑器,数据如何回显到网页,如何回显到编辑器二次编辑

参考网站&#xff1a; 安装使用参考&#xff1a;vue2-常用富文本编辑器使用介绍 html网页展示、编辑器回显二次编辑参考&#xff1a;快速搞懂前端项目如何集成Markdown插件mavon-editor&#xff0c;并回显数据到网页 安装命令 npm install mavon-editor2.9.1 --save全局配置 …...

2、Python面试题解析:如何进行字符串插值?

Python字符串插值详解 字符串插值是将变量或表达式嵌入字符串中的一种技术&#xff0c;Python提供了多种方式实现字符串插值。以下是常见的几种方法及其详细解析和代码示例。 1. 百分号&#xff08;%&#xff09;格式化 这是Python早期版本中的字符串插值方法&#xff0c;类似…...

VB.net复制Ntag213卡写入UID

本示例使用的发卡器&#xff1a;https://item.taobao.com/item.htm?ftt&id615391857885 一、读取旧Ntag卡的UID和数据 Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click轻松读卡技术支持:网站:Dim i, j As IntegerDim cardidhex, …...

STM32+rt-thread判断是否联网

一、根据NETDEV_FLAG_INTERNET_UP位判断 static bool is_conncected(void) {struct netdev *dev RT_NULL;dev netdev_get_first_by_flags(NETDEV_FLAG_INTERNET_UP);if (dev RT_NULL){printf("wait netdev internet up...");return false;}else{printf("loc…...

【磁盘】每天掌握一个Linux命令 - iostat

目录 【磁盘】每天掌握一个Linux命令 - iostat工具概述安装方式核心功能基础用法进阶操作实战案例面试题场景生产场景 注意事项 【磁盘】每天掌握一个Linux命令 - iostat 工具概述 iostat&#xff08;I/O Statistics&#xff09;是Linux系统下用于监视系统输入输出设备和CPU使…...

全球首个30米分辨率湿地数据集(2000—2022)

数据简介 今天我们分享的数据是全球30米分辨率湿地数据集&#xff0c;包含8种湿地亚类&#xff0c;该数据以0.5X0.5的瓦片存储&#xff0c;我们整理了所有属于中国的瓦片名称与其对应省份&#xff0c;方便大家研究使用。 该数据集作为全球首个30米分辨率、覆盖2000–2022年时间…...

定时器任务——若依源码分析

分析util包下面的工具类schedule utils&#xff1a; ScheduleUtils 是若依中用于与 Quartz 框架交互的工具类&#xff0c;封装了定时任务的 创建、更新、暂停、删除等核心逻辑。 createScheduleJob createScheduleJob 用于将任务注册到 Quartz&#xff0c;先构建任务的 JobD…...

学校招生小程序源码介绍

基于ThinkPHPFastAdminUniApp开发的学校招生小程序源码&#xff0c;专为学校招生场景量身打造&#xff0c;功能实用且操作便捷。 从技术架构来看&#xff0c;ThinkPHP提供稳定可靠的后台服务&#xff0c;FastAdmin加速开发流程&#xff0c;UniApp则保障小程序在多端有良好的兼…...

Cloudflare 从 Nginx 到 Pingora:性能、效率与安全的全面升级

在互联网的快速发展中&#xff0c;高性能、高效率和高安全性的网络服务成为了各大互联网基础设施提供商的核心追求。Cloudflare 作为全球领先的互联网安全和基础设施公司&#xff0c;近期做出了一个重大技术决策&#xff1a;弃用长期使用的 Nginx&#xff0c;转而采用其内部开发…...

基于Docker Compose部署Java微服务项目

一. 创建根项目 根项目&#xff08;父项目&#xff09;主要用于依赖管理 一些需要注意的点&#xff1a; 打包方式需要为 pom<modules>里需要注册子模块不要引入maven的打包插件&#xff0c;否则打包时会出问题 <?xml version"1.0" encoding"UTF-8…...

C++.OpenGL (10/64)基础光照(Basic Lighting)

基础光照(Basic Lighting) 冯氏光照模型(Phong Lighting Model) #mermaid-svg-GLdskXwWINxNGHso {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-GLdskXwWINxNGHso .error-icon{fill:#552222;}#mermaid-svg-GLd…...

UR 协作机器人「三剑客」:精密轻量担当(UR7e)、全能协作主力(UR12e)、重型任务专家(UR15)

UR协作机器人正以其卓越性能在现代制造业自动化中扮演重要角色。UR7e、UR12e和UR15通过创新技术和精准设计满足了不同行业的多样化需求。其中&#xff0c;UR15以其速度、精度及人工智能准备能力成为自动化领域的重要突破。UR7e和UR12e则在负载规格和市场定位上不断优化&#xf…...