{"version":"1.0","type":"rich","title":"format dates","description":"This example demonstrates how to standardize date formatting across different stages of a data lifecycle in a PHP application. It shows how dates are converted to a database-friendly `Y-m-d` format during validation and then reformatted to a display-friendly `m/d/Y` format when records are retrieved. The code uses PHP’s `date()` and `strtotime()` functions within a Yii framework model, applying the transformations to three specific date columns and also cleaning a monetary value by stripping dollar signs. The logic is implemented through the `beforeValidate()` and `afterFind()` model hooks.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-32b3fef1a1ea77e847d6?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}