Skip to content

Instantly share code, notes, and snippets.

@jomasero
Created July 30, 2013 21:40
Show Gist options
  • Select an option

  • Save jomasero/6117254 to your computer and use it in GitHub Desktop.

Select an option

Save jomasero/6117254 to your computer and use it in GitHub Desktop.
Formatear fechas UNIX
<?php
date_default_timezone_set('America/Costa_Rica');
$todayDate = time();
$hoy = date("Y-m-d\TH:i:s\Z", $todayDate);
$deadLine = date("Y-m-d\TH:i:s\Z", 347883748);
echo '<p style="color: red">Ahora: '. $hoy .'<br />Deadline: ' .$deadLine . '</p>';
if ($todayDate > $fechaLimite) echo '<p style="color: green">Yahoooo!!!</p>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment