Tuesday, July 21, 2009

//------------------------------------------------------------------------------
//
// dods2unix($dods_date)
//
// This routine turns a dods-style date into a unix timestamp. It should work
// after 07dec08 (the date I wrote it) but not sure how it would work for
// earlier dates due to the fact that I don't know for sure how things like
// leap year are handled.
//
// (Note: 1228629600 is the unix timestamp for midnight December 7th, 2008.
// 733384 is the dods-style date for December 7th, 2008)
//
//
//------------------------------------------------------------------------------
function dods2unix($dods_date){
return (1228629600 + 60*60+($dods_date - 733384)*86400);
// the 60*60 is for local machine vs mountain time zone...
// you may need to mess with this...
}

No comments:

Post a Comment