western willow ventures inc.

eye on the net
  • Home
  • Contact
  • Web
  • Graphics
  • ARDi
  • Samples
  • Terms of Service
  • Fun
  • Privacy

Search

Home | Blogs | Franco's blog

Messing with Dates in Drupal

Mon, 2010-03-08 16: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 |  206 reads |  Tags: drupal, php

Popular content

Today's:

  • ready for the oven
  • graphicsScreenCap.jpg
  • Contact

All time:

  • Contact
  • Web
  • ARDi - Aerial Research Drone One

Last viewed:

  • Ubuntu Shortcut keys
  • How to determine how many processoers your Linux Box has and How fast.
  • Importing MythTV Recordings into MythTV (Or restoring your files and putting them back into MythTV)

Navigation

  • Login
  • Album photos
  • Contact form
  • Feed aggregator
© 2010 Western Willow Ventures Inc.

Designed by Heidi Selzler.