`date` command from nixpkgs' coreutils shows wrong time

I’ve got Nix on Ubuntu 24.04. The date command from the system (/usr/bin/date) shows the proper date. However, the date command from nixpkgs coreutils shows the wrong date, and seems to be displaying the time zone improperly (see below).

Any idea of what the issue might be?

❯ which date
/usr/bin/date

❯ date
Tue May 13 09:14:36 AM EDT 2025

❯ nix shell nixpkgs#coreutils

❯ which date
/nix/store/cg09nslw3w6afyynjw484b86d47ic1cb-coreutils-9.7/bin/date

❯ date
Tue May 13 01:14:49 PM America 2025

This is important because it’s causing a time mismatch issue in a database in my dev environment

1 Like

Can’t repro on my system, must be a configuration difference. Just noticed you’re on Ubuntu, I’m sure that’s related somehow.
What’s the output of timedatectl?

So curiously I just finally switched my computer to be on NixOS. It was previously running arch, I did a somewhat dirty install onto the existing root and behold

~ 
❯ timedatectl
               Local time: Tue 2025-05-13 15:31:16 BST
           Universal time: Tue 2025-05-13 14:31:16 UTC
                 RTC time: n/a
                Time zone: Europe/London (BST, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

~ 
❯ date
Tue May 13 03:31:22 PM BST 2025

What is also amusing is that it just seems to in the terminal??? Because the date on waybar is correct which is being set with

❯ cat -p ~/.config/waybar/config
[
  {
    "cpu": {
      "format": "<U+F4BC>{usage: >3}%"
    },
    "custom/clock": {
      "exec": "date +'%F %H:%M:%S'",
      "format": "{}",
      "interval": 1
    },
    "height": 34,
    "layer": "top",
    "modules-left": [
      "niri/window"
    ],
    "modules-right": [
      "tray",
      "cpu",
      "custom/clock"
    ],
    "position": "top",
    "spacing": 8
  }
]

the date command

EDIT: actually that’s stupid

~ 
❯ date +'%F %H:%M:%S'
2025-05-13 15:35:44

~ 
❯ date
Tue May 13 03:35:46 PM BST 2025 

I guess I just need to read the date man pages to fix my problem.

EDIT 2:
OK… apparently I just need to step away from the computer because I thought it was saying 03 AM. Which is clearly doesn’t. GOODBYE EVERYONE IGNORE THIS POST.

❯ timedatectl
               Local time: Tue 2025-05-13 15:12:57 EDT
           Universal time: Tue 2025-05-13 19:12:57 UTC
                 RTC time: Tue 2025-05-13 19:12:57
                Time zone: America/New_York (EDT, -0400)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

On second look I think the times in your original post are coherent, just in different formats. If you want a specific format you could try e.g. date -Iseconds or one of the format options from the manpage.