western willow ventures inc.

eye on the net
  • Home
  • Contact
  • Web
  • Graphics
  • ARDi
  • Samples
  • Your Photos on Canvas
  • My Photos on Canvas
Home | Blogs | Franco's blog

Messing with Dates in Drupal

Mon, 2010-03-08 17:15 |  Franco

Dates and how they are used in drupal is a PITA.

this snippet of code helps to remember the easy way of moving dates back and forth in and out of timestamp format

$today['raw string'] = '2010-03-09 13:00:00';
$today['unix']=strtotime($today['raw string']);
$today['array']=getdate($today['unix']);
$today['YYYY-MM-DD HH:MM:SS']=date("Y-m-d H:i:s",$today['unix']);
$today['drupal-default']=format_date($today['unix']);
dpm ($today);

Franco's blog |  Login to post comments |  Tags: drupal, php

Navigation

  • Contact form
  • Feed aggregator
  • Lab
© 2010 Western Willow Ventures Inc.

Designed by Heidi Selzler.