![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| get partial numbers from a string | jimmy_y | Shell Programming and Scripting | 1 | 08-24-2009 05:35 PM |
| [Perl] Find one string, change another string. | ejdv | Shell Programming and Scripting | 5 | 06-10-2009 03:44 AM |
| delete line from file if successful partial string found | cronjob78 | UNIX for Advanced & Expert Users | 7 | 05-14-2009 02:35 AM |
| Perl: Better way to match string within a string | Juha | Shell Programming and Scripting | 3 | 01-11-2009 10:09 PM |
| PerL Reverse the string. | email-lalit | Shell Programming and Scripting | 3 | 07-18-2008 07:22 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
| Bits Awarded / Charged to pludi for this Post | |||
| Date | User | Comment | Amount |
| 08-25-2009 | jimmy_y | N/A | 500 |
|
||||
|
Quote:
works.![]() ---------- Post updated at 02:11 AM ---------- Previous update was at 02:08 AM ---------- Below is the finally code, hope this is the most simple method. i have two date, i want to get the duration in to hhmmss format. Below is the working code. Code:
$a = localtime(UnixDate(ParseDate("20090823 08:03:35"),"%s"));
$b = localtime(UnixDate(ParseDate("20090823 12:04:55"),"%s"));
$c = str2time($b)-str2time($a);
$hms=sprintf("%02d%02d%02d",int($c/3600),int($c%3600/60),int($c%60));
print $hms;
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|