Skip to content

Instantly share code, notes, and snippets.

@xatest
Created November 7, 2012 13:16
Show Gist options
  • Save xatest/4031527 to your computer and use it in GitHub Desktop.
Save xatest/4031527 to your computer and use it in GitHub Desktop.
计算过期时间
<?php
date_default_timezone_set('UTC');
$now = "2000-1-1 00:00:00";
$now = strtotime($now);
// 2678400 = 31 * 24 * 60 * 60
$expireDate = $now + 2678400;
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