Jump to content

Quick question about the way dates are handled

p4 changes date help question

  • Please log in to reply
2 replies to this topic

#1 Lord_Migit



  • Members
  • Pip
  • 9 posts

Posted 10 May 2015 - 03:52 PM

Hey guys. I am quite new to this, so this might sound like a silly question, but bare with me.

I am using the command

p4 changes -m 1 -s submitted //depot/mainline/...@2015/05/10

in order to get the most recent changelist submitted to the mainline as long as it was submitted today. But the problem I am having is that the information coming back out is always from the previous day. So for the line above I will get the latest change from 2015/05/09, which strikes me as quite odd. I guess it is not super hard for me to fix, I just set my script up to add 1 to the current date, but it seems weird and I was just wondering if this is intentional or if I am doing something wrong.

I did a bunch of other checks to make sure I was not being stupid, checked the date on the server and passed the command line a date and time period but to no avail.

Any help is much appriciated! :)

#2 P4Sam


    Advanced Member

  • Members
  • PipPipPip
  • 484 posts
  • LocationSan Francisco, CA

Posted 11 May 2015 - 04:03 AM

Try this instead:

p4 changes -m 1 -s submitted //depot/mainline/...@2015/05/10,@now

If you provide a single revision specifier to a command that accepts a range, it's taken as the end of the range (where the beginning is unbounded) -- so the query you're running is "show me the first change submitted BEFORE 2015/05/10".  By specifying a range with a beginning and an end, you can indicate that you want changes submitted on or after a date, and on or before right now.

#3 Lord_Migit



  • Members
  • Pip
  • 9 posts

Posted 11 May 2015 - 07:43 AM

Ahh I see, thanks very much for your help. I had tried the @now paramater but only ever by itself rather than in a range.


Also tagged with one or more of these keywords: p4 changes, date, help, question

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users