Mismatch in lastModified time ?
I have a piece of code which extracts, amongst other things, the "lastModifiedDate" for a file..
If I compare lastModifiedDate with the date/time I see in the history through the UI there is a mismatch of about times
The code returned 2009-11-26 16:04:53, but UI views of the files (show history), refer to the change in terms of the change set, the time is 26th November 16:29
I'd like to understand what the file.modified() refers to as I'd like to present a consistant set of data.
regards
John
IFileItemHandle hFile = (IFileItemHandle) item;
IFileItem file = (IFileItem) configuration
.fetchCompleteItem(hFile, monitor);
IContributorHandle hCont = file.getModifiedBy();
IContributor contrib = (IContributor) im.fetchCompleteItem(
hCont, IItemManager.DEFAULT, monitor);
String lastModifiedDate = file.modified().toString().substring(0,19);
String lastModifiedBy = contrib.getUserId();
String componentName = component.getName();
If I compare lastModifiedDate with the date/time I see in the history through the UI there is a mismatch of about times
The code returned 2009-11-26 16:04:53, but UI views of the files (show history), refer to the change in terms of the change set, the time is 26th November 16:29
I'd like to understand what the file.modified() refers to as I'd like to present a consistant set of data.
regards
John
One answer
The file time is the time the file was checked into the repo.
The Show History time is labeled the time the change set was created.
On Sun, 29 Nov 2009 09:53:02 -0500, jkelly
<john> wrote:
The Show History time is labeled the time the change set was created.
On Sun, 29 Nov 2009 09:53:02 -0500, jkelly
<john> wrote:
I have a piece of code which extracts, amongst other things, the
"lastModifiedDate" for a file..
IFileItemHandle hFile =
(IFileItemHandle) item;
IFileItem file = (IFileItem) configuration
.fetchCompleteItem(hFile, monitor);
IContributorHandle hCont = file.getModifiedBy();
IContributor contrib = (IContributor)
im.fetchCompleteItem(
hCont, IItemManager.DEFAULT, monitor);
String lastModifiedDate =
file.modified().toString().substring(0,19);
String lastModifiedBy = contrib.getUserId();
String componentName = component.getName();
If I compare lastModifiedDate with the date/time I see in the history
through the UI there is a mismatch of about times
The code returned 2009-11-26 16:04:53, but UI views of the files (show
history), refer to the change in terms of the change set, the time is
26th November 16:29
I'd like to understand what the file.modified() refers to as I'd like
to present a consistant set of data.
regards
John