You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by bhamilton <bh...@allrelated.name> on 2009/03/03 17:05:04 UTC
Common Net 1.4.1
I'm using Common Net 1.4.1, the FTPClient listFiles() method to an array
of FTPFile objects. The Calendar object, within the FTPFile object, has
a TimeZone of GMT. One question is how is that determined? On the
client machine, the default TimeZone is 'America/New_York'.
The dates returned in the Calendar are not consistent. When the process
ran at 6:02 this morning, a certain file had a date time of 20080303
06:05:00. When the process ran 5 minutes later, at 6:07am, the same
file had a date and time of 20090303 06:05:00.
Any thoughts?
Thanks!
Brenda Hamilton
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: Common Net 1.4.1
Posted by Rory Winston <ro...@gmail.com>.
Hi Brenda
Sorry I missed your posting initially. It should be possible to tell
FTPClient the server time zone, if it cant figure it out: this may do
what you want.
Have a look at the FTPClientConfig class (this is 2.0 javadoc, but this
hasnt changed since 1.4, IIRC):
http://commons.apache.org/net/apidocs/org/apache/commons/net/ftp/FTPClientConfig.html
Let me know if this works
Rory
bhamilton wrote:
> I think I may see the problem.
>
> The files on the remote server at stored with the date time in GMT
> where as my client server is 'American/New_York'. The ftp client gets
> the results of the LIST command. Suppose a file 'A' has a date 'Mar
> 03' and time of '13:00'. That date and time is GMT. If the ftp
> client date is 'Mar 03' and time of '12:30', then the time of '13:00'
> is in the future and the list parser assumes the file year is 2008.
>
> Now to think of a workaround...
>
> bhamilton wrote:
>> A little more information. The FTPFile Calendar object is reporting
>> the year, for most of the files as 2008. All of the files are from
>> 2009.
>>
>> bhamilton wrote:
>>> The client process is running on a linux. I can't confirm, but I
>>> believe the ftp server is also a linux machine. I can normalize the
>>> times between the differing TimeZones but the dates returned by the
>>> FTPClient listFiles(), run 5 minutes apart, return different years
>>> for the same file.
>>>
>>> Rusty Wright wrote:
>>>> The underlying operating system, unix for sure, but I'm not sure
>>>> about windows, stores time values in GMT. When it *displays* them
>>>> it converts them to whatever the local time zone is.
>>>>
>>>>
>>>> bhamilton wrote:
>>>>> I'm using Common Net 1.4.1, the FTPClient listFiles() method to an
>>>>> array of FTPFile objects. The Calendar object, within the FTPFile
>>>>> object, has a TimeZone of GMT. One question is how is that
>>>>> determined? On the client machine, the default TimeZone is
>>>>> 'America/New_York'.
>>>>>
>>>>> The dates returned in the Calendar are not consistent. When the
>>>>> process ran at 6:02 this morning, a certain file had a date time
>>>>> of 20080303 06:05:00. When the process ran 5 minutes later, at
>>>>> 6:07am, the same file had a date and time of 20090303 06:05:00.
>>>>>
>>>>> Any thoughts?
>>>>>
>>>>> Thanks!
>>>>> Brenda Hamilton
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: Common Net 1.4.1
Posted by bhamilton <bh...@allrelated.name>.
I think I may see the problem.
The files on the remote server at stored with the date time in GMT where
as my client server is 'American/New_York'. The ftp client gets the
results of the LIST command. Suppose a file 'A' has a date 'Mar 03' and
time of '13:00'. That date and time is GMT. If the ftp client date is
'Mar 03' and time of '12:30', then the time of '13:00' is in the future
and the list parser assumes the file year is 2008.
Now to think of a workaround...
bhamilton wrote:
> A little more information. The FTPFile Calendar object is reporting
> the year, for most of the files as 2008. All of the files are from 2009.
>
> bhamilton wrote:
>> The client process is running on a linux. I can't confirm, but I
>> believe the ftp server is also a linux machine. I can normalize the
>> times between the differing TimeZones but the dates returned by the
>> FTPClient listFiles(), run 5 minutes apart, return different years
>> for the same file.
>>
>> Rusty Wright wrote:
>>> The underlying operating system, unix for sure, but I'm not sure
>>> about windows, stores time values in GMT. When it *displays* them
>>> it converts them to whatever the local time zone is.
>>>
>>>
>>> bhamilton wrote:
>>>> I'm using Common Net 1.4.1, the FTPClient listFiles() method to an
>>>> array of FTPFile objects. The Calendar object, within the FTPFile
>>>> object, has a TimeZone of GMT. One question is how is that
>>>> determined? On the client machine, the default TimeZone is
>>>> 'America/New_York'.
>>>>
>>>> The dates returned in the Calendar are not consistent. When the
>>>> process ran at 6:02 this morning, a certain file had a date time of
>>>> 20080303 06:05:00. When the process ran 5 minutes later, at
>>>> 6:07am, the same file had a date and time of 20090303 06:05:00.
>>>>
>>>> Any thoughts?
>>>>
>>>> Thanks!
>>>> Brenda Hamilton
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: Common Net 1.4.1
Posted by bhamilton <bh...@allrelated.name>.
A little more information. The FTPFile Calendar object is reporting the
year, for most of the files as 2008. All of the files are from 2009.
bhamilton wrote:
> The client process is running on a linux. I can't confirm, but I
> believe the ftp server is also a linux machine. I can normalize the
> times between the differing TimeZones but the dates returned by the
> FTPClient listFiles(), run 5 minutes apart, return different years for
> the same file.
>
> Rusty Wright wrote:
>> The underlying operating system, unix for sure, but I'm not sure
>> about windows, stores time values in GMT. When it *displays* them it
>> converts them to whatever the local time zone is.
>>
>>
>> bhamilton wrote:
>>> I'm using Common Net 1.4.1, the FTPClient listFiles() method to an
>>> array of FTPFile objects. The Calendar object, within the FTPFile
>>> object, has a TimeZone of GMT. One question is how is that
>>> determined? On the client machine, the default TimeZone is
>>> 'America/New_York'.
>>>
>>> The dates returned in the Calendar are not consistent. When the
>>> process ran at 6:02 this morning, a certain file had a date time of
>>> 20080303 06:05:00. When the process ran 5 minutes later, at 6:07am,
>>> the same file had a date and time of 20090303 06:05:00.
>>>
>>> Any thoughts?
>>>
>>> Thanks!
>>> Brenda Hamilton
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: Common Net 1.4.1
Posted by bhamilton <bh...@allrelated.name>.
The client process is running on a linux. I can't confirm, but I
believe the ftp server is also a linux machine. I can normalize the
times between the differing TimeZones but the dates returned by the
FTPClient listFiles(), run 5 minutes apart, return different years for
the same file.
Rusty Wright wrote:
> The underlying operating system, unix for sure, but I'm not sure about
> windows, stores time values in GMT. When it *displays* them it
> converts them to whatever the local time zone is.
>
>
> bhamilton wrote:
>> I'm using Common Net 1.4.1, the FTPClient listFiles() method to an
>> array of FTPFile objects. The Calendar object, within the FTPFile
>> object, has a TimeZone of GMT. One question is how is that
>> determined? On the client machine, the default TimeZone is
>> 'America/New_York'.
>>
>> The dates returned in the Calendar are not consistent. When the
>> process ran at 6:02 this morning, a certain file had a date time of
>> 20080303 06:05:00. When the process ran 5 minutes later, at 6:07am,
>> the same file had a date and time of 20090303 06:05:00.
>>
>> Any thoughts?
>>
>> Thanks!
>> Brenda Hamilton
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: Common Net 1.4.1
Posted by Rusty Wright <ru...@gmail.com>.
The underlying operating system, unix for sure, but I'm not sure about windows, stores time values in GMT. When it *displays* them it converts them to whatever the local time zone is.
bhamilton wrote:
> I'm using Common Net 1.4.1, the FTPClient listFiles() method to an array
> of FTPFile objects. The Calendar object, within the FTPFile object, has
> a TimeZone of GMT. One question is how is that determined? On the
> client machine, the default TimeZone is 'America/New_York'.
>
> The dates returned in the Calendar are not consistent. When the process
> ran at 6:02 this morning, a certain file had a date time of 20080303
> 06:05:00. When the process ran 5 minutes later, at 6:07am, the same
> file had a date and time of 20090303 06:05:00.
>
> Any thoughts?
>
> Thanks!
> Brenda Hamilton
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org