548 visitas
How to set timestamps in fixtures with symfony and Doctrine
This is how you set timestamps in a fixtures file to use with symfony and Doctrine:
Text
- // You need to use single quotes if you set a date by hand
- example_date: '2010-02-24 17:17:23'
- // Or, you can use the date function if you need to convert a date from an UNIX timestamp
- example_date: '<?php echo date('Y-m-d H:i:s', time() + rand(60, 172800)) ?>'
Enviado por miguelSantirso hace 7 months — modificado por última vez hace less than a minute