simun Posted July 16, 2009 Share Posted July 16, 2009 i have a date table ina mysql, a form to enter a date in php and a page where a date i shown, how to show a date it format dd.mm.yyyy and not in yyyy-mm-dd ?? Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/ Share on other sites More sharing options...
WolfRage Posted July 16, 2009 Share Posted July 16, 2009 Well for one there are a lot of date functions in PHP, but if the form is taking the date in from the user, then why not just reorganize the date variables as they come in. This is the fastest and easiest solution. http://www.php.net/manual/en/function.date.php Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876522 Share on other sites More sharing options...
simun Posted July 16, 2009 Author Share Posted July 16, 2009 now i have this to show my date <? echo $object->{'datum'}; ?> and this show date like this 2009-07-08 how to make that date is shown like 08.07.2009 im beginer and dot realy understand that link that you give me Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876533 Share on other sites More sharing options...
WolfRage Posted July 16, 2009 Share Posted July 16, 2009 <?php $time=date('d.m.Y',$object->{'datum'}); echo $time; //not tested but I think that will work, let me know if there are errors, and give me the error message. ?> Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876542 Share on other sites More sharing options...
rhodesa Posted July 16, 2009 Share Posted July 16, 2009 Needs to be: $time=date('d.m.Y',strtotime($object->{'datum'})); Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876545 Share on other sites More sharing options...
WolfRage Posted July 16, 2009 Share Posted July 16, 2009 Ahh yes thanks Rhodesa. Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876549 Share on other sites More sharing options...
simun Posted July 16, 2009 Author Share Posted July 16, 2009 now the format is ok but the shown date is 01.01.1970 and in sql table write 2009-12-12 what is the problem here? Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876553 Share on other sites More sharing options...
WolfRage Posted July 16, 2009 Share Posted July 16, 2009 Sounds like you have two different times being inserted. Let's see all of the code, because we can not guess at the possible list of errors. Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876561 Share on other sites More sharing options...
simun Posted July 16, 2009 Author Share Posted July 16, 2009 here is whole page code <?php include('templates/' . $__config['template'] . '/header.php');?> <div id="headerpocetna" style="width: 960px; height: 200px; margin-top:-235px;"></div> <? include('templates/' . $__config['template'] . '/menu2.php'); $object->gallery->getPhotos(); ?> <div id="content"> <h1 style="padding-bottom:10px;"> <a style="text-decoration:none; color:#237DB7;" href=" "><?=$__current['naslov'][$__language]?></a> - <?=$object->{'naziv_' . $__language}?> </h1> <div class="clear"></div> <div style="float:left; width:350px; border-right:solid 1px #cccccc; margin-right:5px;" > <p style=" padding-bottom:5px; font-size:11px;">Datum: <?php $timee=date('d.m.Y',strtotime($object->{'datum'})); echo $timee; ?> </p> </div> <div style="float:left; width:360px; padding-left:10px:" > <p style=" padding-bottom:5px; font-size:11px;"><?=$object->{'opis_' . $__language}?></p> </div> <div class="clear"></div> <h2><?php echo $__l['galerija'] ?></h2> <div class="images-details" > <?php if (is_array($object->gallery->photos)) { foreach($object->gallery->photos as $photo) { $myFile = "files/naslovi/hr/" . $object->id . "/" . $photo['filename'] . ".txt"; $fh = fopen($myFile, 'r'); $theData = fgets($fh); fclose($fh); $myFileen = "files/naslovi/en/" . $object->id . "/" . $photo['filename'] . ".txt"; $fhen = fopen($myFileen, 'r'); $theDataen = fgets($fhen); fclose($fhen); ?> <a class="thickbox" title="<? if ($__language == hr){echo $theData;} else {echo $theDataen;}?>" href="/images/cache/objects/<?=$object->id?>/<?=$photo['filename']?>/w-800.jpg" rel="galler"><? ?><img alt="" src="/images/cache/objects/<?=$object->id?>/<?=$photo['filename']?>/h-98.jpg" /><? ?></a> <?php } } ?> </div> </div> <?php include('templates/' . $__config['template'] . '/footer.php'); ?> Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876565 Share on other sites More sharing options...
WolfRage Posted July 16, 2009 Share Posted July 16, 2009 You never inserted any time into a database, nor did you extract a time, where are you getting this other time from? How does $object get {'datum'}? Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876571 Share on other sites More sharing options...
simun Posted July 16, 2009 Author Share Posted July 16, 2009 here is my page with query and kategorizacija is table where date is stored <?php $sql = 'SELECT * FROM objects WHERE zupanija > ""'; $box=$_POST['box']; while (list ($key,$val) = @each ($box)) { $sql .= '' . $val . '';} $sql .= ' ORDER BY kategorizacija DESC'; if (isset($__current['database']['per_page'])) { $result_total = mysql_query($sql); if ($result_total) { $total_objects = mysql_num_rows($result_total); mysql_free_result($result_total); } $total_pages = ceil((int)$total_objects / (int)$__current['database']['per_page']); if (isset($_GET['l'])) { $limit = $_GET['l']; } $sql .= ' LIMIT ' . (int)$limit . ', ' . (int)$__current['database']['per_page']; } if ((int)$__query[3] > 0) { $object = new S_Object; if ($object->load((int)$__query[3])) { $__current['title'][$__language] = $object->{'naziv_' . $__language} . ' - ' . $__current['title'][$__language]; include('object_galerija.details.php'); } } else { $query = mysql_query($sql); include('templates/' . $__config['template'] . '/header.php');?> <div id="headerpocetna" style="width: 960px; height: 200px; margin-top:-235px;"></div> <? include('templates/' . $__config['template'] . '/menu2.php'); ?> <div id="content"> <div style="float:left"> <h1><?=$__current["title"][$__language]?></h1> </div> <div class="clear"></div> <div style="float:left; padding-top:10px; width:305; padding-right:10px; margin-right:10px; border-right:solid 1px #cccccc;"> <div style="width:305px; font-size:11px; color: #666666; padding-bottom:15px;">Poštovani korisnici, radi lakšeg pregleda, vizualizacije su podjeljene u kategorije. Odabirom željene kategorije prikazati će se samo radovi iz iste.</div> <form action="../"> <select style=" border:solid 1px #cccccc; background-color:#FFFFFF; font-size:12px; color:#666666; padding:2px;" onchange="window.open(this.options[this.selectedIndex].value,'_top')"> <option value="<?php echo '/' . $__language . '/galerija'?>">Sve vizualizacije</option> <option value="<?php echo '/' . $__language . '/galerija_obi'?>">Arh. vizualizacije obiteljskih/stambenih objekata </option> <option value="<?php echo '/' . $__language . '/galerija_pos'?>">Arh. vizualizacije višestambenih objekata </option> <option value="<?php echo '/' . $__language . '/galerija_sak'?>">Arh. vizualizacije javnih/poslovnih objekata </option> <option value="<?php echo '/' . $__language . '/galerija_sta'?>">Arh. vizualizacije urb-arh studija</option> <option value="<?php echo '/' . $__language . '/galerija_stu'?>">Tehničke vizualizacije</option> <option value="<?php echo '/' . $__language . '/galerija_vis'?>">Ostale vizualizacije</option> </select> </form> </div> <div style=" float:left; padding-top:10px; width:350; font-size:11px;"> <div style="width:350px; font-size:11px; color: #666666; padding-bottom:5px;">Primjena samih vizualizacija vrlo je široka, pa smo radi lakšeg pregleda dodali još nekoliko opcija za filtriranje projekata ovisno o njihovom sadržaju.</div> <p> <? echo "<form method=post action=''>"; echo " <div style='font-size:11px; color: #666666; float:left; width:130px; padding-top:3px; padding-bottom:3px;'><input type=checkbox name=box[] value='AND eksterijer = 1 '>Eksterijer</div> <div style='font-size:11px; color: #666666; float:left; width:160px; padding-top:3px; padding-bottom:3px;'><input type=checkbox name=box[] value='AND interijer = 1 '>Interijer</div> <div style='font-size:11px; color: #666666; float:left; width:100px; padding-top:3px; padding-bottom:3px;'><input type=checkbox name=box[] value='AND presjeci3d = 1 '>3D presjeci</div> <div class='clear'></div> <div style='font-size:11px; color: #666666; float:left; width:130px; padding-top:3px; padding-bottom:3px;'><input type=checkbox name=box[] value='AND fotomontaze = 1 '>Fotomontaže</div> <div style='font-size:11px; color: #666666; float:left; width:160px; padding-top:3px; padding-bottom:3px;'><input type=checkbox name=box[] value='AND animacija = 1 '>Animacija/Prezentacija</div> <div style='font-size:11px; color: #666666; float:left; width:100px; padding-top:3px; padding-bottom:3px;'><input type=checkbox name=box[] value='AND katalogs = 1 '>Katalozi</div> <div class='clear'></div> <div style='font-size:11px; color: #666666; 'float:left; width:130px; padding-top:3px; padding-bottom:3px;'><input type=checkbox name=box[] value='AND tablag = 1 '>Reklamne table</div> <div align='right' style='float:right; width:40px; padding-top:3px; padding-bottom:3px; margin-top:-20px;'><input style=' border:solid 1px #cccccc; background-color:#FFFFFF; font-size:12px; color:#666666; padding:2px;' type=submit value=Filtriraj></div> "; ?> </p> </div> <?php echo '<!--' . $sql . '-->'; //************************************************************************ // PAGER //************************************************************************ if ($total_pages > 1) { ?> <div class="pager"> <?php $page_next = $limit + $__current['database']['per_page']; $page_next_limit_string = '/?l=' . $page_next; $page_prev = $limit - $__current['database']['per_page']; $page_prev_limit_string = '/?l=' . $page_prev; if ((int)$page_prev == 0) { $page_prev_limit_string = ''; } if ($page_prev > -1) { ?> <a href="<?php echo '/' . $__language . '/' . $__current['link'][$__language] . $page_prev_limit_string ?>" class="arrow"><<</a> <?php } for ($p = 1; $p <= $total_pages; $p++) { $page_limit = ($p-1)*$__current['database']['per_page']; $page_limit_string = '/?l=' . (int)$page_limit; if ($page_limit == 0) { $page_limit_string = ''; } ?> <a<?php if ($limit == $page_limit) echo ' class="selected"'; ?> href="<?php echo '/' . $__language . '/' . $__current['link'][$__language] . $page_limit_string ?>"><?=$p?></a> <?php } if ($page_next < $total_objects) { ?> <a href="<?php echo '/' . $__language . '/' . $__current['link'][$__language] . $page_next_limit_string ?>" class="arrow">>></a> <?php } ?> </div> <div class="clear"></div> <?php } //************************************************************************ if ($query) { $counter = 0; while ($o = mysql_fetch_assoc($query)) { include('object_galerija.small.php'); $counter++; } } //************************************************************************ // PAGER //************************************************************************ if ($total_pages > 1) { ?> <div class="clear"></div> <div class="pager"> <?php $page_next = $limit + $__current['database']['per_page']; $page_next_limit_string = '/?l=' . $page_next; $page_prev = $limit - $__current['database']['per_page']; $page_prev_limit_string = '/?l=' . $page_prev; if ((int)$page_prev == 0) { $page_prev_limit_string = ''; } if ($page_prev > -1) { ?> <a href="<?php echo '/' . $__language . '/' . $__current['link'][$__language] . $page_prev_limit_string ?>" class="arrow"><<</a> <?php } for ($p = 1; $p <= $total_pages; $p++) { $page_limit = ($p-1)*$__current['database']['per_page']; $page_limit_string = '/?l=' . (int)$page_limit; if ((int)$page_limit == 0) { $page_limit_string = ''; } ?> <a<?php if ($limit == $page_limit) echo ' class="selected"'; ?> href="<?php echo '/' . $__language . '/' . $__current['link'][$__language] . $page_limit_string ?>"><?=$p?></a> <?php } if ($page_next < $total_objects) { ?> <a href="<?php echo '/' . $__language . '/' . $__current['link'][$__language] . $page_next_limit_string ?>" class="arrow">>></a> <?php } ?> </div> <?php } //************************************************************************ ?> </div> <? include('templates/' . $__config['template'] . '/footer.php'); } ?> here is my object_galerija.details.php where i need to show my date <?php include('templates/' . $__config['template'] . '/header.php');?> <div id="headerpocetna" style="width: 960px; height: 200px; margin-top:-235px;"></div> <? include('templates/' . $__config['template'] . '/menu2.php'); $object->gallery->getPhotos(); ?> <div id="content"> <h1 style="padding-bottom:10px;"> <a style="text-decoration:none; color:#237DB7;" href=" "><?=$__current['naslov'][$__language]?></a> - <?=$object->{'naziv_' . $__language}?> </h1> <div class="clear"></div> <div style="float:left; width:350px; border-right:solid 1px #cccccc; margin-right:5px;" > <p style=" padding-bottom:5px; font-size:11px;">Datum: <?php $timee=date('d.m.Y',strtotime($object->{'datum'})); echo $timee; ?> </p> </div> <div style="float:left; width:360px; padding-left:10px:" > <p style=" padding-bottom:5px; font-size:11px;"><?=$object->{'opis_' . $__language}?></p> </div> <div class="clear"></div> <div class="clear"></div> <h2><?php echo $__l['galerija'] ?></h2> <div class="images-details" > <?php if (is_array($object->gallery->photos)) { foreach($object->gallery->photos as $photo) { ?> <a class="thickbox" href="/images/cache/objects/<?=$object->id?>/<?=$photo['filename']?>/w-800.jpg" rel="galler"><? ?><img alt="" src="/images/cache/objects/<?=$object->id?>/<?=$photo['filename']?>/h-98.jpg" /><? ?></a> <?php } } ?> </div> </div> <?php include('templates/' . $__config['template'] . '/footer.php'); ?> and here is my page with form where i add date <?php $object = new S_Object; $object->load((int)$_GET['id']); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // galerija /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if ( $_SERVER['REQUEST_URI'] == '/admin/index.php?page=objects&category=galerija&action=add' ) { $fieldGroups[1] = array( 'title' => 'Opcije prikazivanja', 'fields' => array( 'naslovna' => array( 'type' => 'checkbox', 'name' => 'Prikaži na stranici', ), 'posebna_ponuda' => array( 'type' => 'checkbox', 'name' => 'Izdvojeno', ), ), ); $fieldGroups[2] = array( 'title' => 'Podaci o objektu', 'fields' => array( 'lokacija' => array( 'type' => 'string', 'name' => 'Lokacija', ), 'kategorizacija' => array( 'type' => 'date', 'name' => 'Datum (dd.mm.gggg)', ), 'brdodatnihkreveta' => array( 'type' => 'string', 'name' => 'Klijent', ), 'udaljenostodmora' => array( 'type' => 'string', 'name' => 'Autor', ), 'zupanija' => array( 'type' => 'select', 'name' => 'Vrsta', 'values' => $zupanije, ), ), ); $fieldGroups[13] = array( 'title' => 'Sadržaj projekta', 'fields' => array( 'eksterijer' => array( 'type' => 'checkbox', 'name' => 'Eksterijer', ), 'interijer' => array( 'type' => 'checkbox', 'name' => 'Interijer/Detalji', ), 'presjeci3d' => array( 'type' => 'checkbox', 'name' => 'Presjeci 3d', ), 'fotomontaze' => array( 'type' => 'checkbox', 'name' => 'Fotomontaže', ), 'animacija' => array( 'type' => 'checkbox', 'name' => 'Animacija/Prezentacija', ), 'katalogs' => array( 'type' => 'checkbox', 'name' => 'Katalozi stanova', ), 'tablag' => array( 'type' => 'checkbox', 'name' => 'Table za gradilišta', ), ), ); $fieldGroups[3] = array( 'title' => 'Naziv i opisi', 'fields' => array( 'naziv_hr' => array( 'type' => 'string', 'name' => 'Naziv - hrvatski', 'show_title' => true, ), 'opis_hr' => array( 'type' => 'textarea', 'name' => 'Opis - hrvatski', 'show_title' => false, ), 'naziv_en' => array( 'type' => 'string', 'name' => 'Naziv - engleski', 'show_title' => true, ), 'opis_en' => array( 'type' => 'textarea', 'name' => 'Opis - engleski', 'show_title' => false, ), ), ); $fieldGroups[0] = array( 'title' => '', 'fields' => array( 'type' => array( 'type' => 'select2', 'name' => '', 'values' => $realestateTypes[$_GET['category']], ), ), ); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // software /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if ( $_SERVER['REQUEST_URI'] == '/admin/index.php?page=objects&category=software&action=add' ) { $fieldGroups[1] = array( 'title' => 'Opcije prikazivanja', 'fields' => array( 'naslovna' => array( 'type' => 'checkbox', 'name' => 'Prikaži na stranici', ), 'posebna_ponuda' => array( 'type' => 'checkbox', 'name' => 'Izdvojeno', ), ), ); $fieldGroups[3] = array( 'title' => 'Naziv i opisi', 'fields' => array( 'naziv_hr' => array( 'type' => 'string', 'name' => 'Naziv - hrvatski', 'show_title' => true, ), 'opis_hr' => array( 'type' => 'textarea', 'name' => 'Opis - hrvatski', 'show_title' => false, ), 'naziv_en' => array( 'type' => 'string', 'name' => 'Naziv - engleski', 'show_title' => true, ), 'opis_en' => array( 'type' => 'textarea', 'name' => 'Opis - engleski', 'show_title' => false, ), ), ); $fieldGroups[0] = array( 'fields' => array( 'type' => array( 'type' => 'select2', 'values' => $realestateTypes[$_GET['category']], ), ), ); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // novosti /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if ( $_SERVER['REQUEST_URI'] == '/admin/index.php?page=objects&category=novosti&action=add' ) { $fieldGroups[1] = array( 'title' => 'Opcije prikazivanja', 'fields' => array( 'naslovna' => array( 'type' => 'checkbox', 'name' => 'Prikaži na stranici', ), 'posebna_ponuda' => array( 'type' => 'checkbox', 'name' => 'Izdvojeno iz ponude', ), 'kategorizacija' => array( 'type' => 'date', 'name' => 'Datum (dd.mm.gggg)', ), ), ); $fieldGroups[3] = array( 'title' => 'Naziv i opisi', 'fields' => array( 'naziv_hr' => array( 'type' => 'string', 'name' => 'Naziv - hrvatski', 'show_title' => true, ), 'opis_hr' => array( 'type' => 'textarea', 'name' => 'Opis - hrvatski', 'show_title' => false, ), 'naziv_en' => array( 'type' => 'string', 'name' => 'Naziv - engleski', 'show_title' => true, ), 'opis_en' => array( 'type' => 'textarea', 'name' => 'Opis - engleski', 'show_title' => false, ), ) ); $fieldGroups[0] = array( 'fields' => array( 'type' => array( 'type' => 'select2', 'values' => $realestateTypes[$_GET['category']], ), ), ); } ?> <h1>Dodavanje <?php echo $title . ' '; ?></h1> <?php if (! empty($_GET['message'])) { ?> <div class="message"> <?php echo $_REQUEST['message']; ?> </div> <?php } ?> <script type="text/javascript" src="/js/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ mode : 'textareas', theme: 'advanced', theme_advanced_toolbar_location: 'top', theme_advanced_toolbar_align: 'left', theme_advanced_buttons1 : 'bold,italic,underline,separator,justifyleft,justifycenter,justifyright,fontsizeselect,forecolor,bullist,charmap,cleanup ', theme_advanced_buttons2 : '', theme_advanced_buttons3 : '' }); </script> <form method="post" class="edit"> <?php if (is_array($fieldGroups)) { foreach($fieldGroups as $fieldGroup) { ?> <h2 class="fieldset-title"><?=$fieldGroup['title']?></h2> <? foreach($fieldGroup['fields'] as $f => $field) { ?> <fieldset> <? if ($field['show_title'] !== false) { ?> <label for="input_<?=$f?>"><?php echo $field['name']; ?></label> <? } if ($field['type'] == 'textarea') { ?> <textarea id="input_<?=$f?>" name="<?=$f?>"><?=$object->$f?></textarea> <? } if ($field['type'] == 'checkbox') { ?> <input id="input_<?=$f?>" type="checkbox" name="<?=$f?>"<? if ($object->$f) echo ' checked="checked"'; ?> /> <? } if ($field['type'] == 'date') { ?> <input value="<?=$object->$f?>" id="input_<?=$f?>" name="<?=$f?>"/> <? } if ($field['type'] == 'numeric' || $field['type'] == 'string') { ?> <input id="input_<?=$f?>" type="text" name="<?=$f?>" value="<?=$object->$f?>" /> <? } if ($field['type'] == 'select') { if (! empty($fiels['table'])) { $select = runSQL("SELECT * FROM `" . $field['table'] . "`"); } else { $select = $field['values']; } if (is_array($select)) { ?><select name="<?=$f?>"><? foreach($select as $key => $option) { ?><option<? if ($object->$f==$key) echo ' selected="selected"'; ?> value="<?=$key?>"><?=$option?> </option><? } ?></select><? } } if ($field['type'] == 'select2') { if (! empty($fiels['table'])) { $select = runSQL("SELECT * FROM `" . $field['table'] . "`"); } else { $select = $field['values']; } if (is_array($select)) { ?><select style="margin-left:-1000px;" name="<?=$f?>"><? foreach($select as $key => $option) { ?><option<? if ($object->$f==$key) echo ' selected="selected"'; ?> value="<?=$key?>"><?=$option?> </option><? } ?></select><? } } ?> </fieldset> <? } } } ?> <fieldset class="buttons"> <input type="hidden" name="page" value="<?php echo $_GET['page']; ?>" /> <input type="hidden" name="category" value="<?php echo $_GET['category']; ?>" /> <input type="hidden" name="action" value="<?php echo $_GET['action']; ?>" /> <input type="hidden" name="id" value="<?php echo $_GET['id']; ?>" /> <input type="submit" name="submit" value="Snimi" /> </fieldset> </form> i know it is too much of code, but does that helps you? Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876575 Share on other sites More sharing options...
simun Posted July 16, 2009 Author Share Posted July 16, 2009 i see that ordering by date work fine but date allways shows 01.01.1970 Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876579 Share on other sites More sharing options...
WolfRage Posted July 16, 2009 Share Posted July 16, 2009 Alright a bit too much for me to take in and I only understand half of it, sorry. But if you echo $object->{'datum'} and then echo it with our date and strtotime function what are the two outputs? Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876589 Share on other sites More sharing options...
simun Posted July 16, 2009 Author Share Posted July 16, 2009 goooood, i resoved it but i dont know how , maybbe god change some code for me Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876655 Share on other sites More sharing options...
simun Posted July 16, 2009 Author Share Posted July 16, 2009 i have one more question, in my admin where i add a date i have a form for date with this code <input value="<?=$object->$f?>" id="input_<?=$f?>" name="<?=$f?>"/> how to make here formatig like dd.mm.yyyy ? Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876659 Share on other sites More sharing options...
simun Posted July 16, 2009 Author Share Posted July 16, 2009 it is not SLVED jet Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876664 Share on other sites More sharing options...
rhodesa Posted July 16, 2009 Share Posted July 16, 2009 sorry...unsolved it <input value="<?=date('d.m.Y',strtotime($object->$f))?>" id="input_<?=$f?>" name="<?=$f?>"/> Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876665 Share on other sites More sharing options...
simun Posted July 17, 2009 Author Share Posted July 17, 2009 thats ok, but when i add date like this it dont save it right??? how to make that? if i add 10.10.2000 it save it like 20.10.2010, any idea? Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876940 Share on other sites More sharing options...
rhodesa Posted July 17, 2009 Share Posted July 17, 2009 when saving it into the database, you should always use YYYY-MM-DD format Link to comment https://forums.phpfreaks.com/topic/166218-beginer-date-help/#findComment-876977 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.