[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: API call to retrieve server timestamp / timestamps as offsets?

From: Nik Clayton <nik_at_ngo.org.uk>
Date: 2006-11-01 15:52:38 CET

John Peacock wrote:
> This doesn't have anything to do with Subversion, however. In that case, the
> Subversion client should really be using the timestamps as sent by the server
> and only changing the TZ offset if necessary. The only time that the Subversion
> client should be concerned with local time is when comparing timestamps for
> modifications (which happens in the filesystem quite automatically).

It's a display thing. Suppose the server's time is correct, and the
client's time is 1 minute behind the server because of local clock drift.

Code on the client:

     my $current_time = time(); # Seconds since epoch, in UTC

     printf "Entry was modified %d seconds ago",
          $current_time - ($dirent->time() / 1_000_000); # APR time is
                                                         # nanoseconds

That's going to print the wrong value. And if the dirent was modified
some time in the last 60 seconds

I know, and agree, that this is a configuration problem on the client.
I'm suggesting that client applications could work around this problem
with a little help from Subversion. Perhaps with an API call, something
like:

     my $current_time = SVN::Client::get_time_on_server();

N

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Nov 1 15:53:34 2006

This is an archived mail posted to the Subversion Dev mailing list.