Skip to content

Commit 4cbde11

Browse files
authored
release notes 0.104.0: datetime handling highlights (#1873)
* release notes 0.104.0: datetime handling highlights * fix typos workflow * update after further merges
1 parent c1b86d7 commit 4cbde11

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

blog/2024-01-09-nushell_0_89_0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ Setting the limits is done via flags available in `help ulimit`.
267267
- [Fix the test which fails on windows](https://github.com/nushell/nushell/pull/11478)
268268
- [Fix rm for symlinks pointing to directory on windows (issue #11461)](https://github.com/nushell/nushell/pull/11463)
269269
- [hustcer](https://github.com/hustcer) created
270-
- [Try to fix riscv64 building by using unbuntu-latest](https://github.com/nushell/nushell/pull/11476)
270+
- [Try to fix riscv64 building by using ubuntu-latest](https://github.com/nushell/nushell/pull/11476)
271271
- [Downgrade openssl-src to fix riscv64 build target, close #11345](https://github.com/nushell/nushell/pull/11353)
272272
- [rsteube](https://github.com/rsteube) created
273273
- [Revert "Return external file completions if not empty (#10898)"](https://github.com/nushell/nushell/pull/11446)

blog/2025-04-15-nushell_0_104_0.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,69 @@ As part of this release, we also publish a set of optional [plugins](https://www
4242
for the list of available *containers*
4343
-->
4444

45+
## A lot of improvement and bug fixes regarding datetime handling
46+
47+
Creating durations from non integer numbers used to result in a big loss of precision. This bug is now fixed.
48+
```nushell
49+
~> 1.5wk
50+
# before => 1wk 3day
51+
# now => 1wk 3day 12hr
52+
```
53+
54+
Your local timezone is now accurately taken into account when parsing dates:
55+
```nushell
56+
~> "2025-01-01" | into datetime # standard time (winter)
57+
# => Wed, 1 Jan 2025 00:00:00 +0100 (3 months ago)
58+
~> "2025-06-01" | into datetime # daylight saving time (summer)
59+
# => Sun, 1 Jun 2025 00:00:00 +0200 (in 2 months)
60+
```
61+
62+
It is now possible to construct a datetime and a duration from a record input. If the timezone is not specified, the local is used.
63+
```nushell
64+
~> {year: 2025, month: 3, day: 30, hour: 12, minute: 15, second: 59, timezone: '+02:00'} | into datetime
65+
# => Sun, 30 Mar 2025 12:15:59 +0200 (2 weeks ago)
66+
~> {week: 10, day: 1, hour: 2, minute: 3, second: 4, millisecond: 5, microsecond: 6, nanosecond: 7, sign: '-'} | into duration
67+
# =>
68+
```
69+
70+
Parsing a date as DMY is now possible using the `--format` option:
71+
```nushell
72+
~> "25/03/2024" | into datetime --format "%d/%m/%Y"
73+
# => Mon, 25 Mar 2024 00:00:00 +0100 (a year ago)
74+
```
75+
76+
The next ones are breaking changes.
77+
```md
78+
::: warning Breaking change
79+
See a full overview of the [breaking changes](#breaking-changes)
80+
:::
81+
```
82+
83+
The human readable date parsing has been moved to a dedicated command.
84+
```nushell
85+
date from-human "next Friday at 6pm"
86+
# => 2025-04-18T18:00:00+02:00
87+
```
88+
89+
The ``str join`` command now outputs dates consistently: it is using RFC2822 by default, and RFC3339 for negative dates.
90+
```nushell
91+
~> [ 2024-01-01 ] | str join
92+
# => Mon, 1 Jan 2024 00:00:00 +0000
93+
~> [ ('3000 years ago' | date from-human) ] | str join
94+
# => -0975-04-23T20:57:56.221269600+00:00
95+
```
96+
97+
Now the ``start_timestamp`` column of the SQLite command history contains datetime instead of strings.
98+
```nushell
99+
~> history | last 2
100+
# => ╭───┬─────────────────┬─────────────────────┬─────┬─────╮
101+
# => │ # │ start_timestamp │ command │ cwd │ ... │
102+
# => ├───┼─────────────────┼─────────────────────┼─────┼─────┤
103+
# => │ 0 │ a minute ago │ history │ ... │ ... │
104+
# => │ 1 │ 40 seconds ago │ cd nushell │ ... │ ... │
105+
# => ╰───┴─────────────────┴─────────────────────┴─────┴─────╯
106+
```
107+
45108
# Changes
46109

47110
## Additions

0 commit comments

Comments
 (0)