Describe the bug
Compile/build error: no associated function or constant named now_local found for struct OffsetDateTime in the current scope
To Reproduce
Steps to reproduce the behavior:
cargo install ncgopher
- wait '....'
- See error
Expected behavior
A clean compile/build without any error.
Screenshots
N/A
Desktop (please complete the following information):
~$ cargo --version
cargo 1.96.1 (356927216 2026-06-26) (Fedora 1.96.1-1.fc44)
~$
Additional context
...
Compiling ncgopher v0.8.0
error[E0599]: no associated function or constant named `now_local` found for struct `OffsetDateTime` in the current scope
--> /home/dacbarbos/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ncgopher-0.8.0/src/controller.rs:1483:48
|
1483 | timestamp: OffsetDateTime::now_local().unwrap_or(OffsetDateTime::now_utc()),
| ^^^^^^^^^ associated function or constant not found in `OffsetDateTime`
|
note: if you're trying to build a new `OffsetDateTime` consider using one of the following associated functions:
OffsetDateTime::now_utc
OffsetDateTime::new_in_offset
OffsetDateTime::new_utc
OffsetDateTime::from_unix_timestamp
and 3 others
--> /home/dacbarbos/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/time-0.3.53/src/offset_date_time.rs:105:5
|
105 | pub fn now_utc() -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
153 | pub const fn new_in_offset(date: Date, time: Time, offset: UtcOffset) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
173 | pub const fn new_utc(date: Date, time: Time) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
438 | pub const fn from_unix_timestamp(timestamp: i64) -> Result<Self, error::ComponentRange> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: there is an associated function `now_utc` with a similar name
|
1483 - timestamp: OffsetDateTime::now_local().unwrap_or(OffsetDateTime::now_utc()),
1483 + timestamp: OffsetDateTime::now_utc().unwrap_or(OffsetDateTime::now_utc()),
|
error[E0599]: no associated function or constant named `now_local` found for struct `OffsetDateTime` in the current scope
--> /home/dacbarbos/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ncgopher-0.8.0/src/main.rs:61:39
|
61 | let timestr = OffsetDateTime::now_local()
| ^^^^^^^^^ associated function or constant not found in `OffsetDateTime`
|
note: if you're trying to build a new `OffsetDateTime` consider using one of the following associated functions:
OffsetDateTime::now_utc
OffsetDateTime::new_in_offset
OffsetDateTime::new_utc
OffsetDateTime::from_unix_timestamp
and 3 others
--> /home/dacbarbos/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/time-0.3.53/src/offset_date_time.rs:105:5
|
105 | pub fn now_utc() -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^
...
153 | pub const fn new_in_offset(date: Date, time: Time, offset: UtcOffset) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
173 | pub const fn new_utc(date: Date, time: Time) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
438 | pub const fn from_unix_timestamp(timestamp: i64) -> Result<Self, error::ComponentRange> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: there is an associated function `now_utc` with a similar name
|
61 - let timestr = OffsetDateTime::now_local()
61 + let timestr = OffsetDateTime::now_utc()
|
For more information about this error, try `rustc --explain E0599`.
error: could not compile `ncgopher` (bin "ncgopher") due to 2 previous errors
error: failed to compile `ncgopher v0.8.0`, intermediate artifacts can be found at `/tmp/cargo-installRU3Dht`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_BUILD_BUILD_DIR` to that path.
~$
Describe the bug
Compile/build error: no associated function or constant named
now_localfound for structOffsetDateTimein the current scopeTo Reproduce
Steps to reproduce the behavior:
cargo install ncgopherExpected behavior
A clean compile/build without any error.
Screenshots
N/A
Desktop (please complete the following information):
Additional context