[p4] is it possible to use an epoch value as a revision for command line opperations?
Shawn Hladky
p4shawn at gmail.com
Mon Apr 16 11:17:56 PDT 2007
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:
>
> ... time 1167255874
>
> 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
>
More information about the perforce-user
mailing list