Normally in a rust app, I'd get system time with std::time::SystemTime::now()
, but that doesn't seem to work in a yew app. Instead the component I'm trying to read the system time from just silently (from the server logs) fails and in the web console I get panicked at 'time not implemented on this platform'
.
Which makes sense, the client app can't just grab system time from the OS willy-nilly for security reasons. But does yew provide a way to get this from the browser?
https://crates.io/crates/instant looks like it might do the job. But while it defines fn like now() I don't think that it will make crates that rely on std::time to work :-(
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With