-
AuthorPosts
-
seaneo Friend
seaneo
- Join date:
- December 2009
- Posts:
- 421
- Downloads:
- 4
- Uploads:
- 49
- Thanks:
- 244
- Thanked:
- 12 times in 1 posts
August 5, 2015 at 1:41 pm #656351Hello,
I was wondering if anyone could point out the way to insert the local tiome under or in the date block on the home page?
Many thanks,
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
August 6, 2015 at 3:46 am #656474You can find and change it from templates/ja_teline_v/tpls/blocks/header.php file
<div class="col calendar">
<div class="col-inner">
<span class="number date"><?php echo date('d') ?></span>
<div class="text">
<span class="day"><?php echo JText::_(date('D')) ?></span>, <span class="month"><?php echo JText::_(date('F').'_SHORT') ?></span>
</div>
</div>
</div>
1 user says Thank You to Ninja Lead for this useful post
seaneo Friendseaneo
- Join date:
- December 2009
- Posts:
- 421
- Downloads:
- 4
- Uploads:
- 49
- Thanks:
- 244
- Thanked:
- 12 times in 1 posts
August 6, 2015 at 11:05 am #658575Thanks, Ninja, but is that the code that is already there?
If so, what could be the additional code to add local server time3:15:02 p.m.
(that shows the seconds moving as a user see it)
Thanks
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
August 7, 2015 at 3:54 am #658655You can try with my tweak as below:
Open templates/ja_teline_v/tpls/blocks/header.php file
find and change
<div class="text">
<span class="day"><?php echo JText::_(date('D')) ?></span>, <span class="month"><?php echo JText::_(date('F').'_SHORT') ?></span>
</div>to
<div class="text">
<?php
$date = new DateTime();
$config = JFactory::getConfig();
$date->setTimezone(new DateTimeZone($config->get('offset')));
?>
<span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?></span>
</div>1 user says Thank You to Ninja Lead for this useful post
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
August 7, 2015 at 3:54 am #744750You can try with my tweak as below:
Open templates/ja_teline_v/tpls/blocks/header.php file
find and change
<div class="text">
<span class="day"><?php echo JText::_(date('D')) ?></span>, <span class="month"><?php echo JText::_(date('F').'_SHORT') ?></span>
</div>to
<div class="text">
<?php
$date = new DateTime();
$config = JFactory::getConfig();
$date->setTimezone(new DateTimeZone($config->get('offset')));
?>
<span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?></span>
</div>1 user says Thank You to Ninja Lead for this useful post
seaneo Friendseaneo
- Join date:
- December 2009
- Posts:
- 421
- Downloads:
- 4
- Uploads:
- 49
- Thanks:
- 244
- Thanked:
- 12 times in 1 posts
August 7, 2015 at 2:18 pm #658949Thanks Ninja!
I added <br><br> (the little html i know!) to put some space between the date and time , and then I added one <br> towards the end to get a little more margin space just below the time but it doesnt create that extra space – see http://prntscr.com/81x75z
The code now is:
<div class="col-inner">
<span class="number date"><?php echo date('d') ?></span>
<div class="text">
<?php
$date = new DateTime();
$config = JFactory::getConfig();
$date->setTimezone(new DateTimeZone($config->get('offset')));
?>
<span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <br> <br> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?> <br> </span>
</div>
</div>1) How could I acheive a little more grey space below the time?
2) Is there a way to make the time clock “live” by incrementing second by second, and minute by minute?
3) I am working my with web hoster to get the time to be local time in my part of the world, they are telling me to create a PHP.INI file certain content in it. Is that where your code will get the time from?Many thanks
seaneo Friendseaneo
- Join date:
- December 2009
- Posts:
- 421
- Downloads:
- 4
- Uploads:
- 49
- Thanks:
- 244
- Thanked:
- 12 times in 1 posts
August 7, 2015 at 2:18 pm #744800Thanks Ninja!
I added <br><br> (the little html i know!) to put some space between the date and time , and then I added one <br> towards the end to get a little more margin space just below the time but it doesnt create that extra space – see http://prntscr.com/81x75z
The code now is:
<div class="col-inner">
<span class="number date"><?php echo date('d') ?></span>
<div class="text">
<?php
$date = new DateTime();
$config = JFactory::getConfig();
$date->setTimezone(new DateTimeZone($config->get('offset')));
?>
<span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <br> <br> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?> <br> </span>
</div>
</div>1) How could I acheive a little more grey space below the time?
2) Is there a way to make the time clock “live” by incrementing second by second, and minute by minute?
3) I am working my with web hoster to get the time to be local time in my part of the world, they are telling me to create a PHP.INI file certain content in it. Is that where your code will get the time from?Many thanks
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
August 10, 2015 at 3:15 am #659266You can find the solution with your question
#1) Open templates/ja_teline_v/css/custom.css file (create new if it does not exist) and add new rule
.calendar span.number.date {
margin-top: -8px !important;
}.calendar .text {
margin-top: -4px important;
}
#2, 3) You can get your time zone with the setting from Global Configuration backend of your site, see the screenshot
1 user says Thank You to Ninja Lead for this useful post
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
August 10, 2015 at 3:15 am #744962You can find the solution for your question as below
#1) Open templates/ja_teline_v/css/custom.css file (create new if it does not exist) and add new rule
.calendar span.number.date {
margin-top: -8px !important;
}.calendar .text {
margin-top: -4px important;
}
#2, 3) You can get your time zone with the setting from Global Configuration backend of your site, see the screenshot
1 user says Thank You to Ninja Lead for this useful post
seaneo Friendseaneo
- Join date:
- December 2009
- Posts:
- 421
- Downloads:
- 4
- Uploads:
- 49
- Thanks:
- 244
- Thanked:
- 12 times in 1 posts
August 10, 2015 at 11:19 am #659665Thanks Ninja, I did those twow things and it is perfect.
The only remaining queston is, do you know how to make the clock “live”?
So that the seconds and minutes increment in live time in front of a users eyes?Thanks,
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
seaneo Friendseaneo
- Join date:
- December 2009
- Posts:
- 421
- Downloads:
- 4
- Uploads:
- 49
- Thanks:
- 244
- Thanked:
- 12 times in 1 posts
August 11, 2015 at 1:08 pm #659975Unfortunatly I am not a developer, but thank you anyway foir the reference.
Ok, I retreat, lol..
One final question, in this code you gave me:
<div class="text">
<?php
$date = new DateTime();
$config = JFactory::getConfig();
$date->setTimezone(new DateTimeZone($config->get('offset')));
?>
<span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?></span>
</div>What would be the adjustment to change from:
10:03:46 AM
to:
10:03 AM
Many thanks,
seaneo Friendseaneo
- Join date:
- December 2009
- Posts:
- 421
- Downloads:
- 4
- Uploads:
- 49
- Thanks:
- 244
- Thanked:
- 12 times in 1 posts
August 11, 2015 at 1:08 pm #745132Unfortunatly I am not a developer, but thank you anyway foir the reference.
Ok, I retreat, lol..
One final question, in this code you gave me:
<div class="text">
<?php
$date = new DateTime();
$config = JFactory::getConfig();
$date->setTimezone(new DateTimeZone($config->get('offset')));
?>
<span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?></span>
</div>What would be the adjustment to change from:
10:03:46 AM
to:
10:03 AM
Many thanks,
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
August 12, 2015 at 2:21 am #660043You can change as below
from
<div class="text">
<?php
$date = new DateTime();
$config = JFactory::getConfig();
$date->setTimezone(new DateTimeZone($config->get('offset')));
?>
<span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?></span>
</div>
to
<div class="text">
<?php
$date = new DateTime();
$config = JFactory::getConfig();
$date->setTimezone(new DateTimeZone($config->get('offset')));
?>
<span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i A')) ?></span>
</div>
1 user says Thank You to Ninja Lead for this useful post
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
August 12, 2015 at 2:21 am #745199You can change as below
from
<div class="text">
<?php
$date = new DateTime();
$config = JFactory::getConfig();
$date->setTimezone(new DateTimeZone($config->get('offset')));
?>
<span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i:s A')) ?></span>
</div>
to
<div class="text">
<?php
$date = new DateTime();
$config = JFactory::getConfig();
$date->setTimezone(new DateTimeZone($config->get('offset')));
?>
<span class="day"><?php echo JText::_($date->format('D')) ?></span>, <span class="month"><?php echo JText::_($date->format('F').'_SHORT') ?></span> <span class="time"><?php echo JText::_($date->format('H:i A')) ?></span>
</div>
1 user says Thank You to Ninja Lead for this useful post
-
AuthorPosts
This topic contains 15 replies, has 2 voices, and was last updated by Ninja Lead 9 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum