Welcome Guest, Not a member yet? Register   Sign In
IntlDateFormatter gregorian calendar
#1

Hi

IntlDateFormatter class lets us define a pattern for showing the dates. 
I use the following to show the date in the Georgian calendar :

Code:
$now = new DateTime();

$formatter = new IntlDateFormatter(
                "fa_IR@calendar=persian",
                IntlDateFormatter::FULL,
                    IntlDateFormatter::FULL,
                'Asia/Tehran',
                IntlDateFormatter::TRADITIONAL,
                "yyyy-MM-dd");

// It is now: 1396-12-14
echo 'It is now: ' . $formatter->format($now);

I've read the  CI4 documentation page https://codeigniter4.github.io/userguide.../time.html , but I couldn't figure out how to do it in CI4.

Any help would be appreciated.
Reply


Messages In This Thread
IntlDateFormatter gregorian calendar - by mohs3n - 06-27-2020, 08:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB