[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#20850: acknowledged by developer (Re: bug#20850: Converting under Li
From: |
Bahn, Ingo |
Subject: |
bug#20850: acknowledged by developer (Re: bug#20850: Converting under Linux a by date calculated epochtime back with date, does not return the same data) |
Date: |
Mon, 22 Jun 2015 12:05:36 +0000 |
Hello Pádraig / GNU (coreutils) team,
I hope you had a good weekend and thank you for the quick reply. I appreciate
that.
The -u (UTC) option I also attempted before opening the bug with you, but also
got the same different results between Linux and Cygwin.
But anyways, I guess I found the reason on why I got different results here,
when executing this command on Cygwin under Windows 7 and on different Linux
distributions.
The timestamp I got from the performance reports of one of our vendors contains
a capital "T" between the actual DATESTAMP and the TIMESTAMP:
"2015-06-18T06:27:01"
So when I attempted to convert it into epochtime with the date command in the
first place, I was actually happy about I could do it just like that and did
not dig any deeper into this.
But apparently whatever character is between the DATESTAMP and the TIMESTAMP
here, influences some kind of offset:
Here is what I get when I convert the actual epoch-start-time "01-Jun-1970
00:00:00":
#####---- LINUX - CentOS, SuSE
#
#-- Conversion with a WHITESPACE between DATESTAMP and TIMESTAMP returns "0":
date -u -d "1970-01-01 00:00:00" +%s
0
#-- Conversion with a capital "T" between DATESTAMP and TIMESTAMP returns
"-25200":
date -u -d "1970-01-01T00:00:00" +%s
-25200
##### ---- Windows7 - CygWin
#
#-- Conversion with a WHITESPACE between DATESTAMP and TIMESTAMP returns "0":
date -u -d "1970-01-01 00:00:00" +%s
0
#-- Conversion with a capital "T" between DATESTAMP and TIMESTAMP returns "0"
too:
date -u -d "1970-01-01T00:00:00" +%s
0
... Apparently on CygWin this Offset returns "0" in both cases.
At the of my reply end pls. find for your references what is returned when
there are other characters of the alphabet between the DATESTAMP and TIMESTAMP
So I have no idea whether this is intentionally so or not, but I will update my
teams internally here at my organisation, to strip about any possibly character
between the DATESTAMP and the TIMESTAMP to get the same results independant
from the environment they write their code on. Because with a WHITESPACE the
offset appears to be "0" across the board.
I won#t pursue this topic / bug any further with you, but for sure will be
available in case of any additonal informations or data gathering would be
required from my end
Thank you again and have a succesfull week
With highest regards
Ingo Bahn
-------- -------- -------- --------
Ingo Bahn
Gematik / test and certification
phone: +49 (30) 400 41-458
E-Mail: address@hidden
#---- LINUX - CentOS, SuSE
#
#-- Converting with WHITESPACE and "A" through "Z" between the DATESTAMP and
TIMESTAMP:
: 0
A: 3600
B: 7200
C: 10800
D: 14400
E: 18000
F: 21600
G: 25200
H: 28800
I: 32400
date: invalid date `1970-01-01J00:00:00'
K: 36000
L: 39600
M: 43200
N: -3600
O: -7200
P: -10800
Q: -14400
R: -18000
S: -21600
T: -25200
U: -28800
V: -32400
W: -36000
X: -39600
Y: -43200
Z: 0
#---- Windows7 - CygWin
#
#-- Converting with WHITESPACE and "A" through "Z" between the DATESTAMP and
TIMESTAMP:
: 0
A: 3600
B: 7200
C: 10800
D: 14400
E: 18000
F: 21600
G: 25200
H: 28800
I: 32400
date: invalid date '1970-01-01J00:00:00'
K: 36000
L: 39600
M: 43200
N: -3600
O: -7200
P: -10800
Q: -14400
R: -18000
S: -21600
T: 0
U: -28800
V: -32400
W: -36000
X: -39600
Y: -43200
Z: 0
##### Script used starts below -----------------------------
#!/bin/bash
#
# Converting epoch time start from human format into counter
# ... with having different characters between DATE and- TIMESTAMP
#
# INB @ TST/NET @ Gematik Jun 2015
#
date -u -d "1970-01-01 00:00:00" +" ":%t%s
date -u -d "1970-01-01A00:00:00" +"A":%t%s
date -u -d "1970-01-01B00:00:00" +"B":%t%s
date -u -d "1970-01-01C00:00:00" +"C":%t%s
date -u -d "1970-01-01D00:00:00" +"D":%t%s
date -u -d "1970-01-01E00:00:00" +"E":%t%s
date -u -d "1970-01-01F00:00:00" +"F":%t%s
date -u -d "1970-01-01G00:00:00" +"G":%t%s
date -u -d "1970-01-01H00:00:00" +"H":%t%s
date -u -d "1970-01-01I00:00:00" +"I":%t%s
date -u -d "1970-01-01J00:00:00" +"J":%t%s
date -u -d "1970-01-01K00:00:00" +"K":%t%s
date -u -d "1970-01-01L00:00:00" +"L":%t%s
date -u -d "1970-01-01M00:00:00" +"M":%t%s
date -u -d "1970-01-01N00:00:00" +"N":%t%s
date -u -d "1970-01-01O00:00:00" +"O":%t%s
date -u -d "1970-01-01P00:00:00" +"P":%t%s
date -u -d "1970-01-01Q00:00:00" +"Q":%t%s
date -u -d "1970-01-01R00:00:00" +"R":%t%s
date -u -d "1970-01-01S00:00:00" +"S":%t%s
date -u -d "1970-01-01T00:00:00" +"T":%t%s
date -u -d "1970-01-01U00:00:00" +"U":%t%s
date -u -d "1970-01-01V00:00:00" +"V":%t%s
date -u -d "1970-01-01W00:00:00" +"W":%t%s
date -u -d "1970-01-01X00:00:00" +"X":%t%s
date -u -d "1970-01-01Y00:00:00" +"Y":%t%s
date -u -d "1970-01-01Z00:00:00" +"Z":%t%s
#
#End of script
##### Script used ends above -----------------------------
-----Original Message-----
From: GNU bug Tracking System [mailto:address@hidden
Sent: Friday, June 19, 2015 7:18 PM
To: Bahn, Ingo
Subject: bug#20850 acknowledged by developer (Re: bug#20850: Converting under
Linux a by date calculated epochtime back with date, does not return the same
data)
This is an automatic notification regarding your bug report
#20850: Converting under Linux a by date calculated epochtime back with date,
does not return the same data, which was filed against the coreutils package.
Thank you for your report, which has now been closed.
You can view the full report at
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20850
If you require further information, please followup to address@hidden
debbugs.gnu.org maintainers
(administrator, GNU bugs database)