-
Notifications
You must be signed in to change notification settings - Fork 0
API Host ScriptDate
基于 DateTimeOffset 的脚本日期包装类型。
Script date wrapper over DateTimeOffset.
命名空间:AuroraScript.Runtime.Types。类型:class。
Namespace:
AuroraScript.Runtime.Types. Kind: class.
ScriptDate 是公开宿主类型。通过下方签名选择调用方式;对运行时对象、生命周期和异常,应由宿主在边界处明确处理。
Script date wrapper over DateTimeOffset.
下面是 ScriptDate 的最小使用方式。
A minimal use of
ScriptDate.
var date = new ScriptDate(
new DateTimeOffset(2026, 8, 19, 0, 0, 0, TimeSpan.Zero));
Console.WriteLine(date.Format("yyyy-MM-dd")); // 2026-08-19签名
ScriptDate(DateTime date)ScriptDate(DateTimeOffset dateTimeOffset)ScriptDate(long ticks)
创建 ScriptDate 实例。
Use the member according to its public signature.
Parameters:
-
date
按签名提供的DateTime参数。The
DateTimeparameter required by the signature. -
dateTimeOffset
按签名提供的DateTimeOffset参数。The
DateTimeOffsetparameter required by the signature. -
ticks
按签名提供的long参数。The
longparameter required by the signature.
Returns
新建的 ScriptDate 实例。
A new
ScriptDateinstance.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
var value = new ScriptDate(/* 参数 */);读取 DateTime 属性。
Use the member according to its public signature.
Parameters:
- 无。
None.
Returns
返回 DateTimeOffset。
Returns
DateTimeOffset.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptDate value = /* 从宿主 API 获取实例 */;
var current = value.DateTime;签名
int Yearint Monthint Dayint Hourint Minuteint Secondint MillisecondDayOfWeek DayOfWeekint DayOfYearlong Ticks
读取 Components 属性。
Use the member according to its public signature.
Parameters:
- 无。
None.
Returns
返回值取决于所选重载;请查看签名。
Return value depends on the selected overload; see the signatures.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptDate value = /* 从宿主 API 获取实例 */;
var current = value.Components;调用 Format 完成其公开操作。
Use the member according to its public signature.
Parameters:
-
format
按签名提供的string参数。The
stringparameter required by the signature.
Returns
返回 string。
Returns
string.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptDate value = /* 从宿主 API 获取实例 */;
var result = value.Format(/* format */);AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License