简体   繁体   English

目录列表日期格式在新年期间如何更改(FTP)

[英]How does directory list date format change over new year (FTP)

I am parsing a datetime from an FTP listing. 我正在从FTP列表解析日期时间。

I realise that all FTP clients are different, but I'm wondering what generally happens with year changes? 我意识到所有FTP客户端都是不同的,但是我想知道年份更改通常会发生什么?

eg For recent files, the format might be 例如,对于最新文件,格式可能是

Mar 09 01:32

For old files, the format might be 对于旧文件,格式可能是

Mar 04 2002

When does the switchover happen from showing the time to showing the year? 从显示时间到显示年份的切换何时发生? Is it 是吗

  • as soon as the year changes (ie on Jan 1st, anything from December will have a year rather than time) 年份更改后(即1月1日,从12月开始的任何年份都将是一年而不是时间)
  • as soon as the file is more than one year old (ie if there's not a year, then you know it's less than one year old) 文件超过一年的时间(即如果没有一年,那么您知道它不到一年)
  • other 其他

I understand there probably isn't a definitive answer - but if there's a "normal" way, then I'd like to know about it. 我知道可能没有明确的答案-但是,如果有一种“正常”的方式,那么我想知道。

Not quite an answer - but the best I've got - is to assume that your average FTP server is going to act like linux. 并不是一个很好的答案-而是我所能拥有的最好的-假设您的普通FTP服务器将像Linux一样工作。

In this case, it seems that the time is replaced by the year in 6 month delay. 在这种情况下,时间似乎被延迟6个月的年份所代替。

eg today - March 22nd 2011 - I've found some files on a linux server like this: 例如今天-2011年3月22日-我在linux服务器上发现了一些文件,如下所示:

drwxr-xr-x  2 user user     4096 Sep 16  2010 blahdir
-rw-r-----  1 user user        0 Sep 27 11:05 blahfile

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM