timediff

timediff 是一个 Rust 工具库,用于打印可阅读的相对时间段,支持 i18n。它是 Day.js 的 Rust 实现,弥补了 Rust 生态中类似工具的缺失。

Check out timediff on CurateClick

• Copy the embed code to showcase this product on your website

• Share on X to spread the word about this amazing tool

  • 项目地址:https://github.com/lryong/timediff- 语言:Rust- 项目描述:前端同学基本都知道 Moment.jsDay.js,其中 Day.js 是 Moment.js 替代工具,被广泛应用在前端项目中。 timediff 是 Day.js 支持 i18n 的一个 Rust 实现,用于打印不同语言的时间段表达,易于用户理解, 配合 humantime 基本可以完成 Day.js 的所有功能。 timediff 时间段的计算也遵循 Day.js 的规则,它很好地弥补了这个场景下的工具缺失。- 代码使用样例: rust use timediff::*; use timediff::TimeDiffError as Error; assert_eq!( TimeDiff::to_diff(String::from("-10s")) .locale(String::from("zh-CN")) .unwrap() .parse(), Ok(String::from("几秒前")) );

Latest Weekly Picks

make.ink favicon
Weekly Pick

Your AI tattoo generator for pro-grade concepts

Leo Wade
sellfy.com favicon
Weekly Pick

A code-free online store builder to turn views into revenue. Sell digital products, subscriptions, and merch, without fees or hassle.

Maris
www.videotoblog.ai favicon
Weekly Pick

Convert videos into awesome blog posts.

Video To Blog
www.sellerpic.ai favicon
Weekly Pick

SellerPic is the all-in-one AI design platform for e-commerce

SellerPic
fastimage.ai favicon
Weekly Pick

Fast Image AI instantly transforms your photos into stunning styles like Ghibli, Sketch, and Pixar. Effortlessly control image elements and create amazing effects with just one click.

Fast AI Team
linkedinpro.daisy.so favicon
Weekly Pick

AI-powered tool that transforms casual photos into professional LinkedIn headshots instantly. No photographer needed—just upload and download.

Gabriel
crevas.ai favicon
Weekly Pick

Crevas unifies Veo 3, Sora 2, Nano Banana and more into one intuitive canvas — so filmmakers can script, prompt, and generate cinematic stories without switching tools or losing consistency.

Spark Alpha
fotominiatur.com favicon
Weekly Pick

AI Foto Edit - Text to Image & Image Edit

foto miniatur