Produces the current time on the server, updated every second.
Note: Due to platform limitations, the date returned will be a native Date object of the exact timestamp but with an arbitrary time zone. The time zone information should be disregarded.
Date
1.0.0
function MyComponent() { const now = useServerNow(); return <div>{now.toLocaleString()}</div>;} Copy
function MyComponent() { const now = useServerNow(); return <div>{now.toLocaleString()}</div>;}
Produces the current time on the server, updated every second.
Note: Due to platform limitations, the date returned will be a native
Dateobject of the exact timestamp but with an arbitrary time zone. The time zone information should be disregarded.