UnknownError1337
UnknownError1337

Reputation: 1222

I18n how to use with date()?

How to sue i18n in kohana 3 with date()?

echo date('l jS F Y h:i:s A');

I don't know how I can translate day names, month names, etc...

Upvotes: 2

Views: 2550

Answers (1)

Marcos Labad
Marcos Labad

Reputation: 1191

You should use strftime function, together with setlocale, date function does not support localization strings.

In your example, considering you want the date in french, it may be:

<?php

setlocale(LC_ALL, 'fr_FR');

echo strftime("%A %d %B %G %I:%M:%S %p") . "\n";

It will output Mardi 19 novembre 2013 01:41:59 am

Upvotes: 5

Related Questions