You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Daniel Becroft <Da...@supercorp.com.au> on 2008/09/12 05:04:01 UTC

Setting Timezone information in svn:date property

Hi,
 
We are currently converting our old in-house SCM system to an SVN
repository (both client and server running v1.5.2).
 
After loading the revisions, I am trying to modify the svn:date property
to the original modification date. However, it seems that I am unable to
specify the timezone information in the property?
 
For example, I can correctly the set the svn:date property with the
following:
 
    svn propset --revprop --revision 3 svn:date \
        2004-05-06T13:14:15.000000Z svn://localhost/repository
    property 'svn:date' set on repository revision 3
 
However, if I attempt to specify a timezone other than 'Z', I get:
 
    svn: Wrong or unexpected property value
    svn: Bogus date
 
I have tried the following formats (both quoted and unquoted):
 
2004-05-06T13:14:15.000000+10:00
2004-05-06T13:14:15.0+10:00
2004-05-06T13:14:15+10:00
2004-05-06T13:14:15.000000+1000
 
.... etc. but they all result in the above error(s). 
 
I searched the archives, and found a link to the following document
(http://www.w3.org/TR/NOTE-datetime), and as far as I can tell, the
above strings should all be valid ISO8601 format.
 
The default svn:date property value seems to be stored as Zulu, rather
than with the current timezone.
 
Is there a method of specifying the timezone for the svn:date property,
or do I need to convert the times to Zulu and then set the value?
 
Cheers,
Daniel B.

RE: Setting Timezone information in svn:date property

Posted by Daniel Becroft <Da...@supercorp.com.au>.
> -----Original Message-----
> From: John Peacock [mailto:john.peacock@havurah-software.org] 
> Sent: Friday, 12 September 2008 9:23 PM
> To: Daniel Becroft
> Cc: users@subversion.tigris.org
> Subject: Re: Setting Timezone information in svn:date property
> 
> Daniel Becroft wrote:
> > Is there a method of specifying the timezone for the svn:date 
> > property, or do I need to convert the times to Zulu and 
> then set the value?
> 
> All dates in Subversion are rendered as UTC (formerly GMT or 
> Zulu) for universal consistency.  The client will convert 
> local time to UTC when committing (or when using a date 
> option to -r), but the propset special magic for svn:date 
> does not do the conversion, only validates that the time 
> string is a valid result (i.e. 
> must already be UTC).
>
> So, you will need to convert the original commit times to 
> "Zulu" before setting them.  Please also read the red box at 
> the end of this section of the book:

Ah, okay, thanks. I will do that.
 
> http://svnbook.red-bean.com/nightly/en/svn.tour.revs.specifier
s.html#svn.tour.revs.dates
> 
> If your original SCM did not preserve strict date order for 
> each subsequent commit (CVS could do this under certain 
> circumstances), you might have to reorder the commits 
> (tricky) or simply synthesize a date that preserves the 
> order.  This isn't absolutely /required/, but is a good idea 
> if you ever use -r with a date range.

Yeah, we will be applying the commits with some of them out of date
order, but these will be on separate version branches. We don't have an
immediate need for using the -r option for the log messages, and this is
purely for historical purposes anyway. 

Thanks again.
Daniel B.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: Setting Timezone information in svn:date property

Posted by John Peacock <jo...@havurah-software.org>.
Daniel Becroft wrote:
> Is there a method of specifying the timezone for the svn:date property, 
> or do I need to convert the times to Zulu and then set the value?

All dates in Subversion are rendered as UTC (formerly GMT or Zulu) for universal 
consistency.  The client will convert local time to UTC when committing (or when 
using a date option to -r), but the propset special magic for svn:date does not 
do the conversion, only validates that the time string is a valid result (i.e. 
must already be UTC).

So, you will need to convert the original commit times to "Zulu" before setting 
them.  Please also read the red box at the end of this section of the book:

http://svnbook.red-bean.com/nightly/en/svn.tour.revs.specifiers.html#svn.tour.revs.dates

If your original SCM did not preserve strict date order for each subsequent 
commit (CVS could do this under certain circumstances), you might have to 
reorder the commits (tricky) or simply synthesize a date that preserves the 
order.  This isn't absolutely /required/, but is a good idea if you ever use -r 
with a date range.

HTH

John

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org