Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created October 26, 2013 06:21
Show Gist options
  • Select an option

  • Save Shelob9/7165885 to your computer and use it in GitHub Desktop.

Select an option

Save Shelob9/7165885 to your computer and use it in GitHub Desktop.
Takes "yday" key (numeric representation of the day of the year 0-365) from php getthedate() and adds one to get tomorrow, unless it's 31 December, in which case returns 1. MUST FIND USE FOR THIS!
<?php
$today = getdate();
$tomorrow = $today['yday']+1;
if ( ( $tomorrow > 364 && date('L') == 0 ) || ( $tomorrow > 365 && date('L') == 1 ) ) {
$tomorrow = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment