Welcome Guest, Not a member yet? Register   Sign In
Getting day, month and year apart from Db
#4

(This post was last modified: 03-12-2018, 01:21 PM by ivantcholakov. Edit Reason: single quotes )

If you want to use what is built in PHP, have a look at http://php.net/manual/en/function.date-p...format.php

An example:

Code:
$date_parts = date_parse_from_format('Y-m-d', '2018-03-09');
var_dump($date_parts);
// array(12) { ["year"]=> int(2018) ["month"]=> int(3) ["day"]=> int(9) ["hour"]=> bool(false) ["minute"]=> bool(false) ["second"]=> bool(false) ["fraction"]=> bool(false) ["warning_count"]=> int(0) ["warnings"]=> array(0) { } ["error_count"]=> int(0) ["errors"]=> array(0) { } ["is_localtime"]=> bool(false) }
Reply


Messages In This Thread
RE: Getting day, month and year apart from Db - by ivantcholakov - 03-12-2018, 01:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB