2

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...

Glavić
  • 42,781
  • 13
  • 77
  • 107
UnknownError1337
  • 1,222
  • 1
  • 12
  • 16

1 Answers1

5

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

Marcos Labad
  • 1,123
  • 10
  • 11