Manage dates from a form |
Hi, I was wondering what was the best practice for saving a date from a form?
To save each day, month and year field individually as numerical values? 01/01/2020 I have tried many techniques, also to be able to subsequently manage them regarding a possible translation, but I do not find them practical. You sending a form date, day, month and year, how do you manage them?
Personaly, in the database I use ISO forma yyyy-MM-DD
and I use bootstrap css and bootstrap doo all the hard job. I have a smal calendar, it works fine with mobile. just On my view I have this example <div class="form-group row"> <span class="col-sm-2 col-form-label" >Date</span> <div class="col-10"> <?php if ($action == "add"){ $tfdate = date('Y-m-d');} else{$tfdate = $r['tfdate'];} $data = array( 'name' => 'tfdate', 'type' => 'date', 'value' => $tfdate, 'style' => 'form-control' ); echo form_input($data); ?> </div> </div> |
Welcome Guest, Not a member yet? Register Sign In |