Feek's macOS useful tools, utilities and applications thread

Two little utilities which I use regularly. These should be part of the OS.

us2date and date2us

The first converts convert UNIX seconds to UTC ISO date and the second converts ISO date to UNIX seconds.

Save each one with the corresponding filename in /usr/local/bin, make them executable with chmod +x and you can call them from anywhere in the terminal.

Code:
feek@shackbookairm2 ~ % us2date 959468542
2000-05-27T23:02:22
feek@shackbookairm2 ~ % date2us 2026-05-04T04:14:20
1777868060
feek@shackbookairm2 ~ %

Not sure on your use case here - but in MacOS:

Bash:
date
date +%s

You can pass through specific epoch times too:
Bash:
date -j -f %s EPOCHTIME

Does exactly this too built in, a few good examples in man date too. Yours probably works for you, I'm just lazy as like you I have to convert unix epoch time especially to something readable in my job very often. I also like native tooling :D
 
Not sure on your use case here - but in MacOS:
Bash:
date
date +%s

You can pass through specific epoch times too:
Bash:
date -j -f %s EPOCHTIME

Does exactly this too built in, a few good examples in man date too. Yours probably works for you, I'm just lazy as like you I have to convert unix epoch time especially to something readable in my job very often. I also like native tooling :D
You'll need to format for ISO8601 and vice versa -
Bash:
# date -jf "%s" "EPOCHTIME" +"%Y-%m-%dT%H:%M:%S%z"
date -jf "%s" "1778051988" +"%Y-%m-%dT%H:%M:%S%z"

# date -jf "%Y-%m-%dT%H:%M:%S%z" "ISO8601" +%s
date -jf "%Y-%m-%dT%H:%M:%S%z" "2026-05-06T08:19:48+0100" +%s

# UTC
date -juf "%s" "1778051988" +"%Y-%m-%dT%H:%M:%S%z"

Although this isn't technically correct as ISO8601 requires a colon in the time offset and MacOS's 'date' doesn't natively support the ISO8601 output/command nor allows you to format the offset. You would need to install GNU date (Homebrew etc).

If i was rolling Perl, i would just use TimePiece rather that dealing with RegEx and strings (although it's still ISO8601-ish without using external modules) -
Perl:
use Time::Piece;
## Native ISO8601
print Time::Piece->new(1778051988)->datetime;
## Format with time offset (ISO8601)
print Time::Piece->new(1778051988)->strftime('%Y-%m-%dT%H:%M:%S%z');

Edit - And i just realised i spend far to much time dealing with dates and times for work :cry::(
 
Last edited:
EPOCH for the win! it's the only way to maths on time... regex-ing date formats is a PITA as 06/05/2027.. yanks think it's 5th of June...

all my messgaes are now in ISO8601 with a link to https://www.iso.org/iso-8601-date-and-time-format.html for that to explain to people. Our UX team was having kittens when they first saw the message windows, but not a single user complained... they all just got used to it plus it says me having to re-format it within in the script.
 
That's pretty cool.

Code:
whatcable
Desktop Mac: charger identity (FedDetails) is not available (no battery controller).

=== Port-USB-C@1 (USB-C) ===
Thunderbolt / USB4
Supports high-speed data, smart cable.

  • Linked at up to 20 Gb/s × 2
  • Connected via 2 hops: CalDigit, Inc. Thunderbolt 4 Pro Dock → Apple Studio Display XDR
  • Connected device: USB Peripheral, CalDigit, Inc. (0x2188) (PD 3.1)
  • Cable has an e-marker chip (advertises its capabilities)
  • Cable speed: USB4 Gen 3 (20 / 40 Gbps)
  • Cable rated for 5 A at up to 20V (~100W)
  • Cable made by Lintes Technology Co., Ltd. (0x2B1D)

=== Port-USB-C@4 (USB-C) ===
Thunderbolt / USB4
Supports high-speed data, smart cable.

  • Linked at up to 20 Gb/s × 2
  • Connected to Ugreen Ugreen Storage Device
  • Connected device: USB Peripheral, ASMedia Technology Inc. (0x174C) (PD 3.1)
  • Cable has an e-marker chip (advertises its capabilities)
  • Cable speed: USB4 Gen 3 (20 / 40 Gbps)
  • Cable rated for 5 A at up to 50V (~250W)

Cable trust signals:
  ⚠ E-marker reports no vendor identity
    Legitimate USB-IF members ship cables with a non-zero vendor ID. A zeroed VID is a common counterfeit signature.

=== Port-USB-C@6 (USB-C) ===
Slow USB device or charge-only cable
Only USB 2.0 is active. If you expected high speed, the cable may not support it.

  • USB 2.0 only (480 Mbps), no high-speed data
  • This port can't read cable details (USB-only port, no Power Delivery)

=== Port-USB-C@2 (USB-C) ===
Nothing connected
Plug a cable into Port-USB-C@2 to see what it can do.

=== Port-USB-C@3 (USB-C) ===
Nothing connected
Plug a cable into Port-USB-C@3 to see what it can do.

=== Port-USB-C@5 (USB-C) ===
Nothing connected
Plug a cable into Port-USB-C@5 to see what it can do.
 
Yes, quite interesting. I'll probably never look at it again!

Shame it doesn't look at devices plugged into the ports of the Studio displays

The last cable/device here was the USB-C cable that came with my iPhone 17 Pro Max, actually connected to the phone. How rubbish is it that it's basically USB2.

Code:
Desktop Mac: charger identity (FedDetails) is not available (no battery controller).

=== Port-USB-C@1 (USB-C) ===
Thunderbolt / USB4
Supports high-speed data, smart cable.

  • Linked at up to 20 Gb/s × 2
  • Connected to ACASIS TBU405
  • Connected device: Alternate Mode Adapter, LaCie (0x059F) (PD 3.1)
  • Cable has an e-marker chip (advertises its capabilities)
  • Cable speed: USB4 Gen 3 (20 / 40 Gbps)
  • Cable rated for 5 A at up to 20V (~100W)
  • Cable made by Chengdu Convenientpower Semiconductor Co., LTD (0x315C)

Cable trust signals:
  ⚠ E-marker claims EPR support but reports only 20V max VBUS
    The cable's e-marker advertises EPR Capable, but reports its Max VBUS Voltage as 20V. EPR operation needs 48V or 50V VBUS, so the two fields contradict each other.

=== Port-USB-C@2 (USB-C) ===
USB device
SuperSpeed data link is active.

  • SuperSpeed USB (5 Gbps or faster)
  • Cable does not advertise an e-marker (basic cable)

=== Port-USB-C@3 (USB-C) ===
Thunderbolt / USB4
Supports high-speed data, smart cable.

  • Linked at up to 20 Gb/s × 2
  • Connected to Apple Inc. Studio Display
  • Connected device: Alternate Mode Adapter, Apple (0x05AC) (PD 3.1)
  • Cable has an e-marker chip (advertises its capabilities)
  • Cable speed: USB4 Gen 3 (20 / 40 Gbps)
  • Cable rated for 5 A at up to 20V (~100W)
  • Active copper cable, re-timer
  • Cable made by Apple (0x05AC)

=== Port-USB-C@4 (USB-C) ===
Thunderbolt / USB4
Supports high-speed data, smart cable.

  • Linked at up to 20 Gb/s × 2
  • Connected to Apple Inc. Studio Display
  • Connected device: Alternate Mode Adapter, Apple (0x05AC) (PD 3.1)
  • Cable has an e-marker chip (advertises its capabilities)
  • Cable speed: USB4 Gen 3 (20 / 40 Gbps)
  • Cable rated for 5 A at up to 20V (~100W)
  • Active copper cable, re-timer
  • Cable made by Apple (0x05AC)

=== Port-USB-C@5 (USB-C) ===
Slow USB device or charge-only cable
Only USB 2.0 is active. If you expected high speed, the cable may not support it.

  • USB 2.0 only (480 Mbps), no high-speed data
  • Connected device: USB Peripheral, Apple (0x05AC) (PD 3.1)
  • Cable does not advertise an e-marker (basic cable)

=== Port-USB-C@6 (USB-C) ===
Nothing connected
Plug a cable into Port-USB-C@6 to see what it can do.
 
Back
Top Bottom