private function getDatePartOrder()
    {
        $format = nl_langinfo(D_FMT);

        // expand short form format
        $format = str_replace('%D', '%m/%d/%y', $format);

        $day = null;
        $month = null;
        $year = null;

        $matches = array();
        if (
            preg_match('/(%d|%e)/', $format, $matches, PREG_OFFSET_CAPTURE) ===
            1
        ) {
            $day = $matches[0][1];
        }

        $matches = array();
        if (
            preg_match(
                '/(%[bB]|%m)/',
                $format,
                $matches,
                PREG_OFFSET_CAPTURE
            ) === 1
        ) {
            $month = $matches[0][1];
        }

        $matches = array();
        if (
            preg_match('/(%[Yy])/', $format, $matches, PREG_OFFSET_CAPTURE) ===
            1
        ) {
            $year = $matches[0][1];
        }

        if ($day === null || $month === null || $year === null) {
            // fallback to d-m-y if the locale format is unknown
            $order = array('d', 'm', 'y');
        } else {
            $order = array();
            $order[$day] = 'd';
            $order[$month] = 'm';
            $order[$year] = 'y';
            ksort($order);
        }

        return $order;
    }