[p4] is it possible to use an epoch value as a revision for command line opperations?

David Weintraub qazwart at gmail.com
Mon Apr 16 12:11:22 PDT 2007


I see what you're talking about. I can't use the integer date (that "
... time 1167255874" I mentioned earlier) as part of the revision
request.

However, I always thought that the time in the revision specification
is based upon the timezone of the user and not necessarily where the
server is based. Therefore, if I say to the server:

p4 changes ...@">2006/10/11:12:00"

It will give the the list of changes after noon on October, 11, 2006
based upon my local timezone and not based upon noon in London,
England or noon where ever the server happens to be based. I don't
know because I've never worked with Perforce against multiple
timezones, but it would seem to make sense to me.

Is my assumption incorrect? Would the revision time specifier need to
be based upon the Server's timezone and not the local timezone?

If the revision specifier is based upon the server's timezone and not
the local timezone, it still may be possible to pull up the
information he wants by specifying the "-ztag" parameter.

David Casey would first calculate the integer time he wants based upon
the time specification he wants. That can be done with a very short
Perl script. He would then need to list all changelists with the -ztag
parameter, and compare each of the changelists time to the integer
time he is looking for. By doing this comparison, he could find the
changelist that matches his specification. Then, he could use the
changelist number instead of the date.

Would that work?

On 4/16/07, Shawn Hladky <p4shawn at gmail.com> wrote:
> The API (-ztag) reporting commands return the "unix time" (number of seconds
> since January 1, 1970 in GMT).  Unfortunately, the date revision specifiers
> expect the server's timezone.  While that's handy when you work in the same
> timezone as the server, it sucks if you don't :-(
>
> AFIK, there is no way to tell p4 that your revision specifiers are GMT (or
> any other timezone).
>
>
> On 4/16/07, David Weintraub < qazwart at gmail.com> wrote:
> > When I do a "p4 -ztag change 100", I get a line that looks like this:
> >
> >
> >
> > I believe this is the standard "Unix" time of the number of seconds
> > since January 1, 1900 and is based upon GMT. I know I can use the Perl
> > localtime and gmtime functions to pull out the date and time from this
> > number, but I'm not 100% sure if this is in fact GMT based or not.
> >
> > If it is GMT based, then it should be possible to use "p4 -ztag
> > changes" to figure out the last change list based upon this time. Of
> > course, this could be server dependent too. That is, on Unix systems,
> > it is GMT based, but on Windows systems, it is not.
> >
> > Can anyone confirm whether this time is always GMT based or may be
> > based upon the local server?
> >
> > If this is GMT based, than David Casey could use the output of the "p4
> > -ztag" command to pull out the time, and use that without having to
> > worry about the server's local timezone.
> >
> > On 4/16/07, Shawn Hladky < p4shawn at gmail.com> wrote:
> > > I looked into this a bit, and parsing the offset from the server may be
> > > nearly impossible if the server's timezone adjust for daylight savings.
> The
> > > offset (like -0600) is for today, and doesn't take into account whether
> the
> > > server is in daylight time today or not.  The time-zone name from p4
> info
> > > appears to be OS-specific, and it would be a nightmare trying to map all
> the
> > > names to the real timezone.  I was using the .Net framework, which
> doesn't
> > > even have an API for converting between timezones (other than local),
> and
> > > there's a bug in Windows around historical timezones after the DST
> change
> > > this year.
> > >
> > > However, to answer the specific question "what was the most recently
> > > submitted CL on each server as of 3:00:00 GMT yesterday,"  you could
> just
> > > use the offset, if it's OK to be an hour off twice a year.
> > >
> > > It makes me wonder, do people setup their server to be in GMT timezone
> (or
> > > not follow DST) just to avoid these headaches?
> > >
> > >
> > >
> > > On 4/15/07, David Casey < dacasey at adobe.com> wrote:
> > > >
> > > > For example, use integ (?)1176662685 instead of integ
> > > > @2007/04/15:14:44:45.
> > > >
> > > > I work with different servers in different timezones, and would like
> to
> > > > get the most recently submitted CL as of a certain snap time.
> > > >
> > > > (for example, what was the most recently submitted CL on each server
> as
> > > > of 3:00:00 GMT yesterday.)
> > > >
> > > >
> > > >
> > > > Is this possible, or do I need to parse the serverDate offset from p4
> > > > info and then hope I can get my timezone/daylight savings math
> correct?
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Thanks,
> > > >
> > > > -Dave
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > perforce-user mailing list  -  perforce-user at perforce.com
> > > >
> http://maillist.perforce.com/mailman/listinfo/perforce-user
> > > >
> > > _______________________________________________
> > > perforce-user mailing list  -  perforce-user at perforce.com
> > >
> http://maillist.perforce.com/mailman/listinfo/perforce-user
> > >
> >
> >
> > --
> > --
> > David Weintraub
> > qazwart at gmail.com
> >
>
>


-- 
--
David Weintraub
qazwart at gmail.com


More information about the perforce-user mailing list