{"record":{"id":"4778b980263f6ce3","repo":"uutils/coreutils","slug":"setting-date-not-implemented-unsupported-target","errorCode":null,"errorMessage":"setting date not implemented (unsupported target)","messagePattern":"setting date not implemented \\(unsupported target\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/uu/date/src/date.rs","lineNumber":1278,"sourceCode":"}\n\n#[cfg(all(unix, not(target_os = \"redox\")))]\n/// Returns the resolution of the system’s realtime clock.\n///\n/// # Panics\n///\n/// Panics if `clock_getres` fails. On a POSIX-compliant system this should not occur,\n/// as `CLOCK_REALTIME` is required to be supported.\n/// Failure would indicate a non-conforming or otherwise broken implementation.\nfn get_clock_resolution() -> Timestamp {\n    use rustix::time::{ClockId, clock_getres};\n\n    let timespec = clock_getres(ClockId::Realtime);\n\n    #[allow(clippy::unnecessary_cast, reason = \"needed for 32 bit target\")]\n    Timestamp::constant(timespec.tv_sec as _, timespec.tv_nsec as _)\n}\n\n#[cfg(all(unix, target_os = \"redox\"))]\nfn get_clock_resolution() -> Timestamp {\n    // Redox OS does not support the posix clock_getres function, however\n    // internally it uses a resolution of 1ns to represent timestamps.\n    // https://gitlab.redox-os.org/redox-os/kernel/-/blob/master/src/time.rs\n    Timestamp::constant(0, 1)\n}\n\n#[cfg(windows)]\nfn get_clock_resolution() -> Timestamp {\n    // Windows does not expose a system call for getting the resolution of the\n    // clock, however the FILETIME struct returned by GetSystemTimeAsFileTime,\n    // and GetSystemTimePreciseAsFileTime has a resolution of 100ns.\n    // https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime\n    Timestamp::constant(0, 100)\n}\n\n#[cfg(not(any(unix, windows)))]","sourceCodeStart":1260,"sourceCodeEnd":1296,"githubUrl":"https://github.com/uutils/coreutils/blob/85295bbf788bfd7a6926ba692031563504b304b7/src/uu/date/src/date.rs#L1260-L1296","documentation":"Error \"setting date not implemented (unsupported target)\" thrown in uutils/coreutils.","triggerScenarios":"Occurs when date --set is used on a platform where setting the system clock is not implemented.","commonSituations":"Attempting `date -s` on an unsupported target platform lacking a set-time syscall binding.","solutions":["Setting the system date is unsupported on this target; run on a supported platform or use the OS tools.","Use date only for display on this platform, without the -s/--set option."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"85295bbf788bfd7a6926ba692031563504b304b7","analyzedAt":"2026-08-19T21:43:27.871Z","contentChangedAt":"2026-08-19T21:43:27.871Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}