<div style="font-size: xx-small; text-align: center">{$dategroup.date|@formatTime:'%A, %B %d, %Y'}</div>
Code above give "Wednesday, August 16, 2006." Server is synced to Tue Aug 22 20:56:16 2006
What’s that??
Server dategroup.date out of sync
-
bdconnolly
- Regular
- Posts: 140
- Joined: Tue Apr 04, 2006 9:37 pm
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Server dategroup.date out of sync
Hi!
What do you mean? For entries from 2006-08-16 you see entries that are dated to 2006-22-08?
The dategroup date depends on the date of an entry you posted. The date of an entry might be influenced by a Server Timezone Offset you configured.
Best regards,
Garvin
What do you mean? For entries from 2006-08-16 you see entries that are dated to 2006-22-08?
The dategroup date depends on the date of an entry you posted. The date of an entry might be influenced by a Server Timezone Offset you configured.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
bdconnolly
- Regular
- Posts: 140
- Joined: Tue Apr 04, 2006 9:37 pm
Okay Garvin... this is where patience with the feeble is important. 
I am just trying to get the current time/date to display in the template header.
I now understand that I was using the wrong smarty code and need to roll my own. Here's a stab at it.
Edited a config.inc.php file for the template to include:
Tried to add {$time} to the index.tpl.
?
I am just trying to get the current time/date to display in the template header.
I now understand that I was using the wrong smarty code and need to roll my own. Here's a stab at it.
Edited a config.inc.php file for the template to include:
Code: Select all
<?php
$serendipity['smarty']->register_function('time');
function time($smarty) {
return '%A, %B %d, %Y';
}
?>?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
When you register a function, you must call it like a function: {time} and not {$time}.
Then it should work, I guess!
Best regards,
Garvin
When you register a function, you must call it like a function: {time} and not {$time}.
Then it should work, I guess!
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
bdconnolly
- Regular
- Posts: 140
- Joined: Tue Apr 04, 2006 9:37 pm
-
bdconnolly
- Regular
- Posts: 140
- Joined: Tue Apr 04, 2006 9:37 pm
-
bdconnolly
- Regular
- Posts: 140
- Joined: Tue Apr 04, 2006 9:37 pm
config.inc.php in template folder:
This in index.tpl:
Done.
Code: Select all
$serendipity['smarty']->register_function('date_now', 'print_current_date');
function print_current_date($params)
{
$format = $params['format'];
return strftime($format,time());
}
Code: Select all
{date_now format='%A, %B %d, %Y'}-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Excellent work! I knew you could do it.
Best regards,
Garvin
Excellent work! I knew you could do it.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/