type
status
date
Jan 22, 2025 08:16 AM
slug
summary
tags
category
icon
password
1、Lua系统时间文本功能及显示效果
OBS Lua Date and Time脚本可以将OBS中的文本源文本内容自动同步为系统日期和时间,以下是显示日期时间效果:

2、Lua脚本文件与下载地址
免费下载:date-and-time.zip
3、Lua 日期时间脚本安装使用方法
1、下载date-and-time.zip后解压得到:‘date-and-time.lua”文件;
2、在OBS中来源中新建:“文本(GDI)源”;

3、设置文本源名称为:“日期与时间”,设置文本大小为50最佳;

4、在OBS主菜单-工具中选择-脚本,添加下载的‘date-and-time.lua”文件;

5、在脚本对话框中选择‘date-and-time.lua”脚本,右侧的Text Source设置中设置对应的文本源名称:“日期与时间”;

6、Format String 中根据需求设置文本显示的日期与时间格式即可。
日期与时间格式:
默认日期+时间:%Y-%m-%d %X
仅显示时间:%X
仅显示日期:%Y-%m-%d
其它格式参数:
%a | abbreviated weekday name (e.g., Wed ) |
%A | full weekday name (e.g., Wednesday ) |
%b | abbreviated month name (e.g., Sep ) |
%B | full month name (e.g., September ) |
%c | date and time (e.g., 09/16/98 23:48:10 ) |
%d | day of the month ( 16 ) [01-31] |
%H | hour, using a 24-hour clock ( 23 ) [00-23] |
%I | hour, using a 12-hour clock ( 11 ) [01-12] |
%M | minute ( 48 ) [00-59] |
%m | month ( 09 ) [01-12] |
%p | either "am" or "pm" (pm ) |
%S | second ( 10 ) [00-61] |
%w | weekday ( 3 ) [0-6 = Sunday-Saturday] |
%x | date (e.g., 09/16/98 ) |
%X | time (e.g., 23:48:10 ) |
%Y | full year ( 1998 ) |
%y | two-digit year ( 98 ) [00-99] |
%% | the character ` % ´ |
7、效果展示:

另外OBS中文学习网还提供了,在线3D效果日期与时钟:



在OBS来源中添加浏览器,输入此网址即可。
- 作者:摄影人的世界
- 链接:https://www.longshao617.top/article/OBS-Lua-Date%20and-Time
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。