0

Right now I am Working on a reserving system and I got a Problem. I never needed such a thing before. I want the Owner to be able to lock some days with format dd/mm/jjjj . And i want to prevent the owner to input his own format like dd.mm.jj or dd.mm.jjjj how is this possible pref. without date function :) ?

Dont mind my bad eng. wishes from ger.

Kind Regards Marvin

Marvin
  • 3
  • 3
  • 3
    Possible duplicate of [Convert one date format into another in PHP](http://stackoverflow.com/questions/2167916/convert-one-date-format-into-another-in-php) – jmattheis Mar 07 '17 at 11:29
  • Share your some code. And you lock some days when you extract days from date. – A.A Noman Mar 07 '17 at 11:31
  • You can use https://jqueryui.com/datepicker/ and keep date field readonly – Hemantwagh07 Mar 07 '17 at 11:31
  • @Hemantwagh07 well that solved my problem really like I wanted it to be. Im already using another datepicker but forgot about readonly. Thanks :) – Marvin Mar 07 '17 at 11:54

1 Answers1

0

try it with the date method

<?php
$date = "2017-03-07";
date('d.m.Y',strtotime($date));
?>

this snippet outputs 07.03.2017

Best regards from Germany too

David
  • 101
  • 1
  • 7
  • Also tryed this out but the customer who uses the system should not be able to input his own format, so i used the solution Hemantwagh07 suggested with readonly and a datepicker. – Marvin Mar 07 '17 at 12:20
  • Okay, but remind that javascript always can be manipulated by the user – David Mar 07 '17 at 12:56
  • Yes that would be the best way :) – David Mar 07 '17 at 13:10