Skip to content

Instantly share code, notes, and snippets.

@xatest
Created November 7, 2012 12:48
Show Gist options
  • Save xatest/4031429 to your computer and use it in GitHub Desktop.
Save xatest/4031429 to your computer and use it in GitHub Desktop.
计算过期时间
<?php
date_default_timezone_set('UTC');
$now = date("Y-m-d H:i:s");
$expireDate = mktime(date("H", $now), date("i", $now), date("s", $now), date("m", $now), date("d", $now)+31, date("Y", $now));
echo "expire at " . date("Y-m-d H:i:s", $expireDate);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment