datetime() function

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

datetime accepts an optional Date, number or string as its input and formats it with the same options as Intl.DateTimeFormat. If not given any argument, the current date/time is used.


export declare function datetime({ localeMatcher, locales, source }: MessageFunctionContext, options: Record<string, unknown>, input?: unknown): MessageDateTime;


Parameter Type Description
{ localeMatcher, locales, source } MessageFunctionContext  
options Record<string, unknown>  
input unknown (Optional)