PHP School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a PHP Expert!

Join 300,475 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,740 people online right now. Registration is fast and FREE... Join Now!




date subtract using mktime funtion

 

date subtract using mktime funtion

nagarajan22

30 Jun, 2009 - 04:50 AM
Post #1

New D.I.C Head
*

Joined: 28 Jun, 2009
Posts: 8

if anybody know to how to subtract one date to another using mktime fn...

User is offlineProfile CardPM
+Quote Post


CTphpnwb

RE: Date Subtract Using Mktime Funtion

30 Jun, 2009 - 05:13 AM
Post #2

D.I.C Lover
Group Icon

Joined: 8 Aug, 2008
Posts: 2,065



Thanked: 151 times
Dream Kudos: 100
Expert In: PHP

My Contributions
From: http://www.php.net/mktime
CODE
<?php
function utime_add($unixtime, $hr=0, $min=0, $sec=0, $mon=0, $day=0, $yr=0) {
  $dt = localtime($unixtime, true);
  $unixnewtime = mktime(
      $dt['tm_hour']+$hr, $dt['tm_min']+$min, $dt['tm_sec']+$sec,
      $dt['tm_mon']+1+$mon, $dt['tm_mday']+$day, $dt['tm_year']+1900+$yr);
  return $unixnewtime;
}
?>

User is offlineProfile CardPM
+Quote Post

nagarajan22

RE: Date Subtract Using Mktime Funtion

30 Jun, 2009 - 05:28 AM
Post #3

New D.I.C Head
*

Joined: 28 Jun, 2009
Posts: 8

thankyou gentle man.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 03:13AM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month