Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Are strftime value offsets possible?

Status
Not open for further replies.

CHeighlund

Programmer
Jun 11, 2007
163
US
Is there any way to give an offset to the values in a php strftime statement? I'm writing a report that is supposed to be run for end-of-month maintenance and management purposes, but due to the way we're set up, our 'EOM' occurs between three and five days into the next month. (Depends on weekends.)

I've got the report set up already, but the current version looks at the current date (strftime) to determine a few values, like part of the report caption. (Month + Year). Since the report would be getting run half a week into the next month, the month value would always be off, and in a Dec/Jan crossing, the year value would be off as well.

Again, is there any way to offset the strftime values (%M, %B, %G, and potentially %d in my case) so I can get the strftime call to show me the month before, or do I need to set up an if trap for the values and do a manual correction on them?
 
sure. use 'last month' as an offset on the timestamp. or -1 month - same effect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top