#timestamp #portable #formatter #unix-timestamp #format #default

no-std rfc3339

A Portable RFC3339 Timestamp Formatter

1 unstable release

new 0.1.0 Dec 24, 2024

#13 in #unix-timestamp

Download history 95/week @ 2024-12-20

95 downloads per month

MPL-2.0 license

8KB
52 lines

rfc3339

A Portable RFC3339 Timestamp Formatter for Rust. With support for no_std and alloc free environments.

Usage

use rfc3339::format_unix;

fn main() {
    let timestamp = format_unix(1445470140, 0);
    println!("{}", timestamp); // 2015-10-21T23:29:00.000000Z
}

License

Licensed under the Mozilla Public License, version 2.0 (LICENSE).


lib.rs:

Unix Timestamp to RFC3339 Converter

This library provides functionality to convert Unix timestamps into RFC3339 formatted date-time strings, specifically in the UTC timezone. It's designed to work both with and without the standard library (no_std).

Features

  • No standard library dependency when built with default features disabled.
  • Supports heapless operation for embedded environments.

Usage

use rfc3339::format_unix;

let timestamp = format_unix(1609459200, 0);
assert_eq!(timestamp, "2021-01-01T00:00:00.000000Z");

References

License

Licensed under the Mozilla Public License, v. 2.0, see LICENSE for details.

Dependencies

~475KB