Results 1 to 2 of 2

Thread: Output from date --iso-8601=n uses comma for decimal separator [Kali 2022.1]

  1. #1
    Join Date
    2017-Aug
    Posts
    3

    Output from date --iso-8601=n uses comma for decimal separator [Kali 2022.1]

    In a Bash session the following command uses a comma for a decimal separator instead of a period:

    Code:
    ┌──(root㉿kali)-[~]
    └─# date --iso-8601=n
    2022-06-18T20:33:30,155793179-04:00
    If I test with printf it looks like it uses period for decimal separator:

    Code:
    ┌──(root㉿kali)-[~]
    └─# printf "%f" 3.5
    3.500000                                                                                                                                                             
    ┌──(root㉿kali)-[~]
    └─# printf "%f" 3,5
    5.000000

    Config and troubleshooting info:

    Code:
    ┌──(root㉿kali)-[~]
    └─# locale
    LANG=en_US.UTF-8
    LANGUAGE=
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    
    
    ┌──(root㉿kali)-[~]
    └─# locale decimal_point
    .
    
    ┌──(root㉿kali)-[~]
    └─# lsb_release -a
    No LSB modules are available.
    Distributor ID: Kali
    Description:    Kali GNU/Linux Rolling
    Release:        2022.1
    Codename:       kali-rolling
    
    ┌──(root㉿kali)-[~]
    └─# cat /etc/os-release
    PRETTY_NAME="Kali GNU/Linux Rolling"
    NAME="Kali GNU/Linux"
    ID=kali
    VERSION="2022.1"
    VERSION_ID="2022.1"
    VERSION_CODENAME="kali-rolling"
    ID_LIKE=debian
    ANSI_COLOR="1;31"
    HOME_URL="https://www.kali.org/"
    SUPPORT_URL="https://forums.kali.org/"
    BUG_REPORT_URL="https://bugs.kali.org/"
    
    ┌──(root㉿kali)-[~]
    └─# hostnamectl
     Static hostname: kali
           Icon name: computer-vm
             Chassis: vm 🖴
          Machine ID: 2f7f9cc088b74a54aaee8cfbc587c6ea
             Boot ID: 802a9aa463974eee9ecde1d04f79b3d3
      Virtualization: oracle
    Operating System: Kali GNU/Linux Rolling
              Kernel: Linux 5.15.0-kali3-amd64
        Architecture: x86-64
     Hardware Vendor: innotek GmbH
      Hardware Model: VirtualBox
    Question: How do I convince date to use a period for a decimal separator instead of a comma without a lot of hoop jumping?

    Thank-you.

  2. #2
    Join Date
    2021-May
    Posts
    316
    If you want the z terminated time for files etc then try this;

    date -u +"%Y-%m-%dT%H-%M-%SZ"


    or if you want decimal points this;

    date -u +"%Y.%m.%dT%H.%M.%SZ"

Similar Threads

  1. Date and Timing problem In Kali linux
    By Prakhar Misra in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2021-01-02, 19:21
  2. kali-weekly not up-to-date
    By Sherminator in forum General Archive
    Replies: 2
    Last Post: 2017-01-11, 12:34
  3. What is the recommended way to keep Kali Linux up-to-date?
    By WhiteWInterWolf in forum TroubleShooting Archive
    Replies: 5
    Last Post: 2016-11-12, 21:02
  4. Problems to keep Kali 2016.1 up-to-date on persistent USB
    By tatelappie in forum General Archive
    Replies: 4
    Last Post: 2016-09-01, 16:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •