bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20850: Converting under Linux a by date calculated epochtime back wi


From: Bahn, Ingo
Subject: bug#20850: Converting under Linux a by date calculated epochtime back with date, does not return the same data
Date: Fri, 19 Jun 2015 09:03:15 +0000

Good Morning,

 

I am converting a timestamp into the respective epochtime number using the 'date' command from 'coreutils'.

 

When I convert this back however, the result differs from the initial input. I'd expect the same, and which is the case actually under CygWin under WIN7.

 

Under CentOS, which I currently work most with, the result differs and so it does under SuSE Linux. Other Linux distributions I currently don't have access to, to possibly check there further.

 

And because I can re-produce this here under more than one Linux distribution, I am contacting you directly instead the respective distributors.

 

Researching the WWW and your core-utils bug-tracker quickly I cannot find anything, this already is or was addressed at.

 

Below under  "- LOGS and DATA" please see my findings and other informations I am able to provide you and I consider relevant for possibly further trouble shooting from your end.

 

Thank you in advance for your help.

 

With best regards.

 

Ingo Bahn

 

-------- -------- -------- --------

Ingo Bahn

Gematik / test and certification

 

Telefon: +49 (30) 400 41-458

E-Mail: address@hidden

www.gematik.de

 

gematik

Gesellschaft für Telematikanwendungen der Gesundheitskarte mbH

Friedrichstrasse 136

10117 Berlin

Germany

Local district court Berlin-Charlottenburg, register of companies ID: HRB 96351 B

Executive Director: Prof. Dr. Arno Elmer

 

.

 

 

###### ###### ---- Start - LOGS and DATA

#

#

 

- Pre1 - All systems / user environments / shell this was checked at are set to en_US.UTF-8 language

- Pre2 - All systems this was checked at follow CE(S)T

 

   ... Not that I consider the above - Pre1 and Pre2 - really relevant here, but one never knows.

 

- Pre3 - The INPUT timestamp for all is: "2015-06-18T06:27:01"

 

###### --- Linux hosts:

#

#

### --- a) Convert date/time record into epochtime:

#

date -d "2015-06-18T06:27:01" +%s

  1434583621

 

### --- b) Convert epochtime value from a) back into date/time record:

#

date -d @1434583621

  Thu Jun 18 01:27:01 CEST 2015

 

 

### --- c) ... a) and b) in one command:

#

date -d @`date -d "2015-06-18T06:27:01" +%s`

  Thu Jun 18 01:27:01 CEST 2015

#

#

# ... got this under Linux CentOS and SuSE  <=>  OUTPUT --does not-- match INPUT

 

---------------------------------------------------------------------------

 

###### --- WIN7 host:

#

#

### --- a) Convert date/time record into epochtime:

#

date -d "2015-06-18T06:27:01" +%s

  1434601621

 

### --- b) Convert epochtime value from a) back into date/time record:

#

$ date -d @1434601621

  Thu, Jun 18, 2015  6:27:01 AM

 

### --- c) ... a) and b) in one command:

#

date -d @`date -d "2015-06-18T06:27:01" +%s`

  Thu, Jun 18, 2015  6:27:01 AM

#

#

# ... got this under WIN7 - CygWin <=>  OUTPUT matches INPUT

 

---------------------------------------------------------------------------

 

###### --- coreutils / date versions on respective hosts and some other data (uname et.al.)

#

#

 

 

#####                      #######  #####

#     # ###### #    # ##### #     # #     #

#       #      ##   #   #   #     # #

#       #####  # #  #   #   #     #  #####

#       #      #  # #   #   #     #       #

#     # #      #   ##   #   #     # #     #

#####  ###### #    #   #   #######  #####

 

date (GNU coreutils) 8.4

Copyright (C) 2010 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

 

Written by David MacKenzie.

 

# ----

Linux ... 2.6.32-504.23.4.el6.x86_64 #1 SMP Tue Jun 9 20:57:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

centos-release.x86_64                  6-6.el6.centos.12.2

# ----

 

#####          #####  #######

#     # #    # #     # #

#       #    # #       #

#####  #    #  #####  #####

     # #    #       # #

#     # #    # #     # #

#####   ####   #####  #######

 

date (GNU coreutils) 8.12

Copyright (C) 2011 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

 

Written by David MacKenzie.

 

# ----

Linux ... 3.0.101-0.46-default #1 SMP Wed Dec 17 11:04:10 UTC 2014 (8356111) x86_64 x86_64 x86_64 GNU/Linux

"SUSE Linux Enterprise Server 11 (x86_64), VERSION = 11,PATCHLEVEL = 3

"

# ----

 

 

#####               #     # ### #     #

#     # #   #  ####  #  #  #  #  ##    #

#        # #  #    # #  #  #  #  # #   #

#         #   #      #  #  #  #  #  #  #

#         #   #  ### #  #  #  #  #   # #

#     #   #   #    # #  #  #  #  #    ##

#####    #    ####   ## ##  ### #     #

 

date (GNU coreutils) 8.23

Packaged by Cygwin (8.23-4)

Copyright (C) 2014 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

 

Written by David MacKenzie.

 

# ----

CYGWIN_NT-6.1-WOW64 ... 1.7.33-2(0.280/5/3) 2014-11-13 15:45 i686 Cygwin

# ----

#

#

###### ###### ---- End - LOGS and DATA

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]