I own an IIS 7-based FTP with a Unix directory listing on Windows Server 2008 R2.

When I connect to the FTP server and use the dir command I get:

-rwxrwxrwx   1 owner    group           60000 Dec 14  1:00 FILE.TXT

As you see the time is without the leading zero.

I want that the leading zero will appear. I want to get the time like this: 01:00

How can I do that?

link|improve this question

0% accept rate
feedback

1 Answer

It does not appear that the dir command can provide this behavior in any context through command-line switches or other settings alone - the closest is the command line switch \4, which changes the year to output with four digits. Source

However, dir may take its formatting from the operating system's regional settings. To test this, follow the steps:

  1. Go to Start > Control Panel > Region and Language > Formats
  2. Change Short time and Long time to a format starting with hh or HH (hh for 12-hour time and HH for 24-hour or military time). This will enable the leading zero in any application that respects the Windows formatting standard.

Using this technique, I changed my dir to show leading zeros when run from the command prompt in Windows 7. I hope this helps!

link|improve this answer
hi . i tried tje long time short time . it didnt change any thing on the ftp server . – alex Dec 22 '11 at 5:20
@alex just to be clear: you tried changing it on the server that was hosting the FTP process, right? – Jesse Smith Dec 22 '11 at 16:41
The dir command built in to Microsoft's command interpreter has nothing to do with FTP. There is no dir FTP verb. When a user issues a dir command in an FTP client, presuming that the FTP client even supports it in the first place, the FTP client (usually) sends the list FTP verb. There is no standard for what is returned; what is returned by many FTP server softwares, including IIS, is generated by those server softwares; and how the softwares choose to generate such listings has nothing to do with any ls or dir commands available at the command line on the same system. – JdeBP Dec 23 '11 at 16:21
Thanks for the clarification. I learned something today! :) – Jesse Smith Dec 24 '11 at 4:04
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.