Jump to content

DateTime format according to user language


Eunico Cornelius
 Share

Recommended Posts

Hi, I am new to process wire and I've been trying to change the date time format in my webpage according to its language selection(example: English 'd/m/y' , Deutsch: 'd.m.y'). I know that using 

$datetime->getDateFormats();

we can achieve the type of formats in the shape of indexes. Also, by using 

$user->language->id

we can know which language we are using. How do I combine this two functions so that when I select English/Deutsch, the date will be adjusted accordingly?

Is there a specific function that can do this or is there any provided index in the $user->language somewhere. Thanks in advance :).

Link to comment
Share on other sites

Which version are you running?

If you go to Admin > Setup > Fields > yourDateField

don't you see these options in the Details + Input Tabs?

datetimeformat.thumb.PNG.640e041f2ee13b04f1cb670119933f22.PNG

You can define date/time formats for each installed language.

 

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...