开发者

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

开发者 https://www.devze.com 2023-02-17 04:48 出处:网络
I am parsing a datetime from an FTP listing. I realise that all FTP clients are different, but I\'m wondering what generally happens with year changes?

I am parsing a datetime from an FTP listing.

I realise that all FTP clients are different, but I'm wondering what generally happens with year changes?

e.g. 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 (i.e. on Jan 1st, anything fro开发者_如何学运维m December will have a year rather than time)
  • as soon as the file is more than one year old (i.e. 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.

In this case, it seems that the time is replaced by the year in 6 month delay.

e.g. today - March 22nd 2011 - I've found some files on a linux server like this:

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

精彩评论

暂无评论...
验证码 换一张
取 消