mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-27 01:09:32 +00:00
12 lines
486 B
TypeScript
12 lines
486 B
TypeScript
// Memory Core plugin module implements time behavior.
|
|
import { timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
|
|
export function resolveMemoryCoreNowMs(nowMs: unknown): number {
|
|
return timestampMsToIsoString(nowMs) === undefined ? Date.now() : (nowMs as number);
|
|
}
|
|
|
|
export function resolveMemoryCoreTimestamp(nowMs: unknown): string {
|
|
const timestampMs = resolveMemoryCoreNowMs(nowMs);
|
|
return timestampMsToIsoString(timestampMs) ?? new Date().toISOString();
|
|
}
|