Skip to content

Weird error when using into datetime #13280

@freijon

Description

@freijon

Describe the bug

I get a weird error when I try to convert into a specific date:

"09.02.2024 11:06:11" | into datetime --format '%d.%m.%Y %T'
Error: nu::shell::cant_convert

  × Can't convert to could not parse as datetime using format '%d.%m.%Y %T'.
   ╭─[entry #14:1:25]
 1 │ "09.02.2024 11:06:11" | into datetime --format '%d.%m.%Y %T'
   ·                         ──────┬──────
   ·                               ╰── can't convert input is not enough for unique date and time to could not parse as datetime using format '%d.%m.%Y %T'
   ╰────
  help: you can use `into datetime` without a format string to enable flexible parsing

How to reproduce

run:

"09.02.2024 11:06:11" | into datetime --format '%d.%m.%Y %T'

Expected behavior

  1. convert to datetime (this should work?)
  2. if there is really a problem, show an error message that is understandable

Screenshots

No response

Configuration

key value
version 0.94.2
major 0
minor 94
patch 2
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.78.0 (9b00956e5 2024-04-29) (gentoo)
cargo_version cargo 1.78.0
build_time 2024-06-05 16:16:58 +02:00
build_rust_channel release
allocator mimalloc
features default, sqlite, system-clipboard, trash, which
installed_plugins bin_reader

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:datetime-handlingSemantics and implementation of the datetime/duration types and commandsstatus:needs-triageAn issue that hasn't had any proper look

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions