It's all right but when it comes to displaying or saving the date on the database, it's getting like this 1919/1010/2018181818 03:15:16 PM ... I do not know what problem, or if I messed up somewhere. Does anyone know why this is ?? you can see that the time is right but that's only the date.
Settings page (php):
(index)
$this->form_validation->set_rules('dateformat', lang('date_format'), 'required');
$this->form_validation->set_rules('timeformat', lang('time_format'), 'required');
($ data)
'dateformat' => DEMO ? 'jS F Y' : $this->input->post('dateformat'),
'timeformat' => DEMO ? 'h:i A' : $this->input->post('timeformat'),
footer page:
<script type="text/javascript">
var base_url = '<?=base_url();?>';
var dateformat = '<?=$Settings->dateformat;?>', timeformat = '<?= $Settings->timeformat ?>';
<?php unset($Settings->protocol, $Settings->smtp_host, $Settings->smtp_user, $Settings->smtp_pass, $Settings->smtp_port, $Settings->smtp_crypto, $Settings->mailpath, $Settings->timezone, $Settings->setting_id, $Settings->default_email, $Settings->version, $Settings->stripe, $Settings->stripe_secret_key, $Settings->stripe_publishable_key); ?>
var Settings = <?= json_encode($Settings); ?>;
$(window).load(function () {
$('.mm_<?=$m?>').addClass('active');
$('#<?=$m?>_<?=$v?>').addClass('active');
});
</script>
All.js Page:
$('.clock').click( function(e){
e.preventDefault();
return false;
});
function Now() { return new Date().getTime(); }
var stamp = Math.floor(Now() / 1000);
var time = date(dateformat+' '+timeformat, stamp);
$('.clock').text(time);
window.setInterval(function(){
var stamp = Math.floor(Now() / 1000);
var time = date(dateformat+' '+timeformat, stamp);
$('.clock').text(time);
}, 10000);
Page header:
<li class="hidden-xs hidden-sm"><a href="#" class="clock"></a></li>