Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 268037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T23:38:17+00:00 2026-05-11T23:38:17+00:00

I am trying to output dates in the Italian format using date() as follows:

  • 0

I am trying to output dates in the Italian format using date() as follows:

<?php 
    setlocale(LC_ALL, 'it_IT');
    echo date("D d M Y", $row['eventtime']); 
?>

However, it is still coming out in the English format. What else could I do? Is there something wrong?

The solution has to be script specific and not server-wide.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T23:38:17+00:00Added an answer on May 11, 2026 at 11:38 pm

    date() is not locale-aware. You should use strftime() and its format specifiers to output locale-aware dates (from the date() PHP manual):

    To format dates in other languages,
    you should use the setlocale() and
    strftime() functions instead of
    date().

    Regarding Anti Veeranna‘s comment: he is absolutely right, since you have to be very careful with setting locales as they are sometimes not limited to the current script scope. The best way would be:

    $oldLocale = setlocale(LC_TIME, 'it_IT');
    echo utf8_encode( strftime("%a %d %b %Y", $row['eventtime']) );
    setlocale(LC_TIME, $oldLocale);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to output unicode string into RTF format. (using c# and winforms) From
What I'm trying to do is automatically change the output format of dates in
I'm trying to format some dates in PHP (i'm a Coldfusion programmer, so the
I'm trying to output the hex value of a char and format it in
I'm trying to output the following html using an html helper in asp.net mvc
I'm trying to compare 2 dates using javascript. 1 at the end of the
I need some help trying to figure out how to format dates in perl.
I'm trying to use [[NSCalendar currentCalendar] ordinalityOfUnit:NSDayCalendarUnit inUnit:NSEraCalendarUnit forDate:date] on two different dates to
I'm trying to format a date for a given locale new Locale(mk, MK) .
I am trying to grab orders between certain dates using the BETWEEN operator in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.