SimChris Posted May 17, 2013 Share Posted May 17, 2013 Hi, this is one of those things I'm going to feel stupid about asking here, but I need to insert an echo time element in the main page and/or homepage, and not sure of the schema to use inside these templates for the call to php to echo that ... normally I'd do something like <?php echo "<b>".date('l, F jS, Y ')."</b>"; ?> Basically I need to be able to in one place do something like: Today is Sunday, December 9th, 2012 I don't need help with the Apache time settings... just the correct "call' format inside of a CubeCart template to echo this. e.g. { $date = date('Y-m-d H:i:s'); } I haven't tried inserting such calls into a CC template before, oddly enough, even though I've been hacking it since 2010 for our services order system (we sell services, not products). As I said -- going to seem dumb asking that, but thought I'd check before I start messing with it only because it's live and don't want to break something while customer using it (which is murphy's law on this stuff). Thanks in advance, gentle CubeCart fellows :-) Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 18, 2013 Share Posted May 18, 2013 Please try this in the template: {$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'} Adjust the modifiers to suite. This: "%A, %B %e, %Y" returns: Monday, December 1, 2021 (See: http://www.smarty.net/docs/en/language.modifier.date.format.tpl) Quote Link to comment Share on other sites More sharing options...
SimChris Posted May 18, 2013 Author Share Posted May 18, 2013 Hi, bsmither ... thanks!! (oh yeah, how ironic ... totally forgot about the smarty language.... double d'oh. So much for me being a 'smarty' {smile]) For the amount of help and support you provide to everybody here, I hope CC is giving you a stipend :-) That was exactly what I needed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.