Ignore:
Timestamp:
07/10/08 14:09:47 (16 years ago)
Author:
ramonb
Message:

job_monarch/libtoga.php:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web2/addons/job_monarch/libtoga.php

    r532 r533  
    23472347        }
    23482348}
     2349
     2350function timeToEpoch( $time )
     2351{
     2352        $time_fields    = explode( ':', $time );
     2353
     2354        if( count( $time_fields ) == 3 )
     2355        {
     2356                $hours          = $time_fields[0];
     2357                $minutes        = $time_fields[1];
     2358                $seconds        = $time_fields[2];
     2359
     2360        }
     2361        else if( count( $time_fields ) == 2 )
     2362        {
     2363                $hours          = 0;
     2364                $minutes        = $time_fields[0];
     2365                $seconds        = $time_fields[1];
     2366
     2367        }
     2368        else if( count( $time_fields ) == 1 )
     2369        {
     2370                $hours          = 0;
     2371                $minutes        = 0;
     2372                $seconds        = $time_fields[0];
     2373        }
     2374
     2375        $myepoch        = intval( $seconds + (intval( $minutes * 60 )) + (intval( $hours * 3600 )) );
     2376
     2377        return $myepoch;
     2378}
     2379
    23492380function makeTime( $time )
    23502381{
Note: See TracChangeset for help on using the changeset viewer.