varweeks_millis

Crates.iovarweeks_millis
lib.rsvarweeks_millis
version1.0.19
sourcesrc
created_at2023-05-26 09:57:06.275738
updated_at2023-05-26 10:01:34.630263
description2023 new date time units and formats: varweeks and millis
homepagehttps://bestia.dev
repositoryhttps://github.com/bestia-dev/varweeks_millis
max_upload_size
id874912
size28,812
bestia.dev (bestia-dev)

documentation

README

varweeks_millis

2023 new date time units and formats: varweeks and millis
version: 1.0.19 date: 2023-05-26 author: bestia.dev repository: Github

Lines in Rust code Lines in Doc comments Lines in Comments Lines in examples Lines in tests

crates.io Documentation crev reviews RustActions latest doc License Hits

Hashtags: #rustlang #tutorial #datetime
My projects on Github are more like a tutorial than a finished product: bestia-dev tutorials.

Proposal for a new date and time units and formats

Varweeks and millis are my suggestion for new date-time units and formats.
Here is a long read TL;DR about the date-time reform proposal:
https://github.com/bestia-dev/new_date_time_units_and_formats/

Varweeks

A super short explanation:
Years (beginning and end) remain the same as in the CE - common era calendar.
Months are obsolete and they are not used at all in the new format.
Varweek is similar to week. This is the main fragment of the year (not months any more). It is a "variable week" because one year has 52 full varweeks with 7 days. The exception is the last 53rd varweek that has only 1 celebration day. For leap years there are 2 celebration days.
The new year always starts with 01v 1d - short pronunciation one-vee one-dee. Basically every year starts with a monday (one-dee).
Varweek-days are similar to week-days, but without names. They use just numbers and the d unit.
1d (one-dee) is the new name for Monday,
2d (two-dee) is the new name for Tuesday,
3d (three-dee) is the new name for Wednesday,
4d (four-dee) is the new name for Thursday,
5d (five-dee) is the new name for Friday,
6d (six-dee) is the new name for Saturday, and
7d (seven-dee) is the new name for Sunday.
Actually the new names are somehow similar to the old names.
The varweek_date format is global for every language and looks exactly like this:
2023c 52v 2d
The year must have 4 digits from 1000c to 9999c. The unit c stands for CE - common era. Space.
The varweek must have 2 digits from 01v to 53v. The unit v stands for varweek. Space.
The day must have 1 digit from 1d to 7d. The unit d stands for day. End.
This is the usual syntax of the International System of Units. First goes the quantity, then the unit of measure.

Millis

Hours, minutes and seconds are sll obsolete.
One day is divided into 1000md (milliday).
Millis is the short name for milliday. The unit is md.
For shorter time intervals there is microdays or micros, unit μd. 1md has 1000μd.

This crate contains functions to use with the new units varweeks and millis.
It is dependent on the crate chrono for NaiveDate and NaiveTime.

Used in projects

PWA wasm converter and lengthy explanation:
https://github.com/bestia-dev/new_date_time_units_and_formats/
PWA wasm clock:
https://github.com/bestia-dev/varweeks_millis_clock
screenshot

Open-source and free as a beer

My open-source projects are free as a beer (MIT license).
I just love programming.
But I need also to drink. If you find my projects and tutorials helpful, please buy me a beer by donating to my PayPal.
You know the price of a beer in your local bar ;-)
So I can drink a free beer for your health :-)
Na zdravje! Alla salute! Prost! Nazdravlje! 🍻

//bestia.dev
//github.com/bestia-dev
//bestiadev.substack.com
//youtube.com/@bestia-dev-tutorials

Commit count: 5

cargo fmt