Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The state of calendar libraries in Rust is less than ideal. When working with Pandas, there is .tz_convert() and .tz_localize() and that is basically it for timezone conversions. My benchmark for this is: given a date, get first hour of CET/CEST day in UTC. In Pandas a very simple operation. In Chrono, you have to have a NaiveDate, convert to DateTime<FixedOffset> and then to DateTime<Utc>. And there is no pattern in those conversions I managed to find. Sometimes it is a member function, other times a static method on the timezone object.

I hope somebody will rectify this at some point. Jiff seems like a step in a right direction but the syntax is sometimes weird. I guess I’d wellcome something more predictable



That should be `date(y, m, d).intz("Europe/Rome")?`. If you want to get UTC from there, then add `with_time_zone(TimeZone::UTC)`.

> Jiff seems like a step in a right direction but the syntax is sometimes weird. I guess I’d wellcome something more predictable

Can you say more? How can Jiff be better?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: