SCRIPTS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>

7-DAY TOP DOWNLOAD

#
Program
Aircrack 1.0
2,526
Scary Maze
1,392
Virtual Floppy Drive
2.1

1,235
QuickPlay 3.8.4
1,048
JDownload 0.9
915
Netcat 0.7.1
703
ITCN ASP.NET
Enterprise Forum 3.1

618
szewo referer logger
3.0

576
Flash Flip Book
2.0.1

566
KBC Quiz
526
Home / Scripts / Snippets

date_diff Smarty Function

Download button


Downloads: 890  Add to download basket  Tell us about an update
User Rating:
Rated by:
Good (3.0/5)
25 user(s)
Developer:

License / Price:

Platforms:

Databases:

Language:

Last Updated:

Category:
Matt DeKok | More scripts
Other Free / Open Source License 
Windows / Linux / Mac OS / BSD / Solaris
N/A
PHP
July 10th, 2008, 08:56 GMT
C: \ Snippets

 Read user reviews (0)  Add a review  Refer to a friend  Subscribe

 

date_diff Smarty Function description

 

This is a Smarty Function file that can be installed into your plugins for smarty to provide the capability of calculating the time between two dates in either minutes, days, weeks, and years.

This is a Smarty Function file that can be installed into your plugins for smarty to provide the capability of calculating the time between two dates in either minutes, days, weeks, and years.

Input
- date1 = "mm/dd/yyyy" or "yyyy/mm/dd" or "yyyy-mm-dd"
- date2 = "mm/dd/yyyy" or "yyyy/mm/dd" or "yyyy-mm-dd" or $smarty.now
- assign = name of variable to assign difference to
- interval = "days" (default), "weeks", "years"

Examples
- {date_diff date1="5/12/2003" date2=$smarty.now interval="weeks"}
- {date_diff date1="5/12/2003" date2="5/10/2008" assign="diff"}{$diff}
 





TAGS:

calculate time | smarty plugin | date difference | calculate | time | difference



HTML code for linking to this page:


Go to top

Windows tabGames tabDrivers tabMac tabLinux tabScripts tabMobile tabHandheld tabGadgets tabNews tab

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM