this solvedd my inserting data into input field but now i want to insert time stamp by not using the inputfield
<?php echo $this->Form->input("date", array('label' => "Date : ", 'type' => 'text', 'class' => 'fl tal vat w300p', 'error' => false , 'id' => 'select_date')); ?>
<?php echo $this->Html->div('datepicker_img w100p fl pl460p pa', $this->Html->image('calendar.png'),array('id' => 'datepicker_img')); ?>
<?php echo $this->Html->div('datepicker fl pl460p pa', ' ' ,array('id' => 'datepicker')); ?>
I have used the above code for date picker, now i want the timestamp to use in my cakephp.
Sometimes it storing the exact timestamp and some times it is not storing it just using '0000-00-00 00:00:00.000000' value in the database.
if there is any code can any one please help me with the code thanks in advance!
Please add this script in your view
<script>
$(function() {
$( "#YourTableNameYourField").datepicker({
dateFormat: "yy-mm-dd",
changeMonth: true,
changeYear: true,
yearRange:"-100:+50"
});
});
</script>
And your input will be same as
<?php echo $this->Form->create('YourTableName' , array('action'=>'YourAction') );?>
<?php echo $this->Form->input('YourField',array('label'=>false,'div'=>false,'class'=>'form-control','required'=>