Search results for 'Formatted time string'. 1 post(s) found.
- 2007/10/16 PHP date and time formatting
The Smarty date_format function returns a formatted string showing date, time and/or seconds.
index.php:
<?php
$Smarty = new Smarty;
$Smarty->assign('yesterday', strtotime('-1 day'));
$Smarty->display('index.tpl');
?>
$Smarty = new Smarty;
$Smarty->assign('yesterday', strtotime('-1 day'));
$Smarty->display('index.tpl');
?>
index.tpl:
{$Smarty.now|date_format}
{$Smarty.now|date_format:"%A, %B %e, %Y"}
{$Smarty.now|date_format:"%H:%M:%S"}
{$yesterday|date_format}
{$yesterday|date_format:"%A, %B %e, %Y"}
{$yesterday|date_format:"%H:%M:%S"}
{$Smarty.now|date_format:"%A, %B %e, %Y"}
{$Smarty.now|date_format:"%H:%M:%S"}
{$yesterday|date_format}
{$yesterday|date_format:"%A, %B %e, %Y"}
{$yesterday|date_format:"%H:%M:%S"}
sample output :
Feb 6, 2001
Tuesday, February 6, 2001
14:33:00
Feb 5, 2001
Monday, February 5, 2001
14:33:00
Tuesday, February 6, 2001
14:33:00
Feb 5, 2001
Monday, February 5, 2001
14:33:00
Another posts included in "PHP"
| How to declare array in PHP like C/C++ (0) | 2007/10/16 |
| How to pass variables via url (0) | 2007/10/16 |
| How to send email in PHP ? (0) | 2007/10/16 |
| How to redirect browser in PHP ? (0) | 2007/10/16 |
| How to get current filename as variable ? (0) | 2007/10/16 |
| email validation, simple (0) | 2007/10/16 |
| How to ban / block IP addresses (0) | 2007/10/16 |
| for loop - simple (0) | 2007/10/16 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 04:33
moneyideas
-
Subject different money making ideas
2010/01/29 13:33
moneyideas
-
Subject different money making ideas
2010/01/31 16:42
moneyideas

Prev

Rss Feed