From: <rb...@ca...> - 2008-08-31 20:07:13
|
Don't know what OS you're running, but you might try copy the code in this url as "floating.pm" somewhere within MH's @INC. http://code.sixapart.com/svn/movabletype/tags/mt3.32/extlib/DateTime/TimeZone/Floating.pm (BTW, I haven't found obvious references to floating.pm for Debian Etch). Rick ---- xhawkx <xh...@ya...> wrote: > > Mark.. thanks for that reply.. > I have included the DateTime and I now get a compile error that seems to > indicate that DateTime.pm has an include (down in the timezone include) that > is looking for floating.pm. > > floating.pm isn't in the MH distribution. > I can't seem to find it anywhere on my system, or as a seperate download > from anywhere on the internet... > Can anyone help with this? Or possibly another method to accomplish my task? > > Thanks > > > Mark E. Perkins-2 wrote: > > > > On 2008/08/30 17:56, xhawkx wrote: > > > >> Can I take a string date/time and convert it to an epoch time? > >> > > > > There are lots of ways to get the job done, but an easy way is with > > DateTime.pm (an older version of which is part of the mh distribution). > > Sample code included below. > > > > Mark > > > > > > use DateTime; > > > > # get current epoch, print it, extract time components > > my $epoch = time(); > > print "epoch: $epoch\n"; > > my($sec,$min,$hr,$mday,$mon,$yr,$wday,$yday,$isdst) = localtime($epoch); > > > > # convert components back to epoch > > my $dt = DateTime->new( > > year => $yr + 1900, > > month => $mon + 1, > > day => $mday, > > hour => $hr, > > minute => $min, > > second => $sec, > > time_zone => 'US/Eastern' > > ); > > > > my $new_epoch = $dt->epoch(); > > > > > > # print new epoch & diff (which should be 0 but could be 1) > > print "new_epoch: $new_epoch\n"; > > print "epoch_diff: ", $new_epoch - $epoch, "\n"; > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > > challenge > > Build the coolest Linux based applications with Moblin SDK & win great > > prizes > > Grand prize is a trip for two to an Open Source event anywhere in the > > world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > ________________________________________________________ > > To unsubscribe from this list, go to: > > http://sourceforge.net/mail/?group_id=1365 > > > > > > > > -- > View this message in context: http://www.nabble.com/HELP%21%21-Time-comparisons...-UHG-tp19236827p19244836.html > Sent from the Misterhouse - User mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ________________________________________________________ > To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365 > |