Keyword

change date format of mysql column

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
9 years 6 months ago - 9 years 6 months ago #142214 by George Nasis
change date format of mysql column was created by George Nasis
hallo there!

i use a query to extract the publish_up column of the item.

i successfully do that in the query like DATE_FORMAT(publish_up, "%d %M %y") AS 'GEORGE' and then display the column.

But the output for the month is in English and no in my language. I have checked everything in translation files but with no success. Am i missing something?
In the site every other translation works fine.

thank you very much
Last edit: 9 years 6 months ago by George Nasis.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 6 months ago #142220 by Krikor Boghossian
Replied by Krikor Boghossian on topic change date format of mysql column
Where are you trying to display this date? K2 content module, component etc?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
9 years 6 months ago #142270 by George Nasis
Replied by George Nasis on topic change date format of mysql column
hallo Krikor!

i am trying to display it in Community Builder!Everything there is also translated in my language. I read somewhere that it takes the php variables and cannot be affected. is it true?

thank you!

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 6 months ago #142289 by Krikor Boghossian
Replied by Krikor Boghossian on topic change date format of mysql column
This post will help you docs.joomla.org/JFactory/getDate

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
9 years 6 months ago #142297 by George Nasis
Replied by George Nasis on topic change date format of mysql column
hallo krikor!

i read it but i cannot understand how this can help..
i am able to retrieve the date, and the date is right. The only problem is that it is not displayed in my language but in English.

thank you

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 6 months ago #142302 by Krikor Boghossian
Replied by Krikor Boghossian on topic change date format of mysql column
You can try passing, the date as a variable in the JDate function.

EG:
$date = new JDate('now');
echo JHtml::_('date', $date, JText::_('DATE_FORMAT_LC2'));

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum