[
https://issues.apache.org/jira/browse/HDFS-14139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16722432#comment-16722432
]
Ayush Saxena commented on HDFS-14139:
-------------------------------------
Thanx [~pengmq1] for putting this up.verified the scenario at the linux end. It
is inline with what you mentioned.
IMO too Its better to be consistent at both places.
Have uploaded v1 with the fix.
> FsShell ls and stat command return different Modification Time on display.
> --------------------------------------------------------------------------
>
> Key: HDFS-14139
> URL: https://issues.apache.org/jira/browse/HDFS-14139
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: fs, shell
> Reporter: Fred Peng
> Assignee: Ayush Saxena
> Priority: Major
> Labels: easyfix
> Attachments: HDFS-14139-01.patch
>
>
> When we run "hdfs dfs -ls" or "hdfs dfs -stat" on the same file/directory,
> the time of results are different.
> Like this:
> >> $ ./hdfs dfs -stat /user/xxx/collie-pt-canary
> >> 2018-12-10 10:04:57
> >> ./hdfs dfs -ls /user/xxx/collie-pt-canary
> >> -rw-r--r-- 3 xxx supergroup 0 2018-12-10 18:04
> Strangely, we found the time is different(8 hours). The stat command uses UTC
> timezone, but the Ls command uses system local timezone.
> Why does the stat command use UTC timezone, but Ls not?
> {code:java}
> // in Stat.java
> timeFmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
> timeFmt.setTimeZone(TimeZone.getTimeZone("UTC"));{code}
> By the way, in Unix/Linux the ls and stat return the same time on display.
> Should we unify the timezone?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]