Japanese Date in this format

1999 in japanese
uk date format
us date format
time format by country
how to write 2020 in japanese
how to write 2018 in japanese
how to say what is the date today in japanese
1995 in japanese

I'm wanting show the Date in Japanese in this format:

2010年2月18日(木)

which translates to:

February 18, 2010 (Thu)

in PHP

This is the code I have:

    function date_japan() {
    $dy  = date("w");

    $dys = array("日","月","火","水","木","金","土");
    $dyj = $dys[$dy];
      echo date('Y') . '年 ' . date('m') . '月 ' . date('d') . '日' . '(' . $dyj . ')';
    }
    date_japan();

Any improvements would be much appreciated. Thanks.

The easiest and most pragmatic way is probably to create a wrapper function around the date function:

function date_japan() {
  echo date('Y') . '年 ' . date('m') . '月 ' . date('d') . '日';
}

List of date and date/time formats - 2.3, , being close to or influenced by the US, have picked it up from the US, indicating that it is a US creation. But if you are residing in Japan, it is always useful to know your date of birth in Japanese years. This is an example of an age chart. The first column has the Japanese year, the second is the Gregorian calendar year, the third the animal of the year according to the Chinese zodiac, and the last is the current age of a person born in that year.

With IntlDateFormatter, you may format any (well, supported) languages.

if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    exit ('IntlDateFormatter is available on PHP 5.3.0 or later.');
}    
if (!class_exists('IntlDateFormatter')) {
    exit ('You need to install php_intl extension.');
}
$longFormatter = new IntlDateFormatter(
    'ja_JP',
    IntlDateFormatter::LONG,
    IntlDateFormatter::NONE
);
$weekdayFormatter = new IntlDateFormatter(
    'ja_JP',
    IntlDateFormatter::NONE,
    IntlDateFormatter::NONE,
    date_default_timezone_get(),
    IntlDateFormatter::GREGORIAN,
    'EEEEE' // weekday in one letter
);

$datetime = new DateTime("2010-02-18");
echo $longFormatter->format($datetime)
    . '(' . $weekdayFormatter->format($datetime) . ")\n";

This should give you,

2010年2月18日(木)

and you can also get another language with different locale names.

If you are okay with the format

2010年2月18日木曜日

which PHP (and ICU library PHP internally calls) thinks the proper format for full Japanese date, the code would be simpler. Like this,

$fullFormatter = new IntlDateFormatter(
    'ja_JP',
    IntlDateFormatter::FULL,
    IntlDateFormatter::NONE
);
$datetime = new DateTime("2010-02-18");
echo $fullFormatter->format($datetime) . "\n";

Then, you will never worry when you need to add more languages support in future. Your code will be free from Japanese-specific handling.

Reading Japanese Numbers and Dates, The order is reversed compared to Europe: the year comes first, then the month and finally the day; this is the “big endian” format, which is widely used in Asia. A tool to convert between Japanese dates and Western dates

This post is pretty old, but in case someone is still looking for an answer, this worked well for me:

setlocale(LC_ALL, "ja_JP.utf8"); 
$date_format = "%Y年%B%e日(%a)";                  

$date_string = strftime($date_format, time())

Why does the US use MM/DD/YYYY? ( middle-endian , This means that conversion of recent dates is trivial: Japanese month and day agree with In order to convert a Western date to Japanese, one also needs the Following the format of datenbasis.pdf, we give the above in tabular format. Date formats. The date format employed in Japan is the same international date format used in many other parts of the word: year, month, day in that order. Once again, it is common to use numerals to make it easier to read. You may encounter another calendar native to Japan based on the reign of each emperor when filling out public documents.

here is what i used...Ripped from Cameron's code ;-)

$days = array("日","月","火","水","木","金","土");
$date = @date('Y年 m月 d日 (').($dys[@date("w")]).('曜) ').@date('H:i');

Date format by country, The easiest and most pragmatic way is probably to create a wrapper function around the date function: function date_japan() { echo date('Y') . converts a date field to a local date and displays it. the date is then formatted using edit mask JPDAT. since this representation uses Japanese characters, ust it in the Japanese version of sap system only. For reports try. WRITE: D1 USING EDIT MASK '==JPDAT', 'JPDAT'. Reward points if found informative and helpful. Balaji. Message was edited by:

$date_japan = date('Y年m月d日', date("w"));

How to write the date in Japanese, What is the right Japanese translation of "yyyy-mm-dd"? The meaning is year-​month-day as a date format.. Is the following trying correct? The ISO 8601 format (2019-09-21) is intended to harmonize these formats and ensure accuracy in all situations. Many countries have adopted it as their sole official date format, though even in these areas writers may adopt abbreviated formats that are no longer recommended.

Japanese Date Format, Date formats. The date format employed in Japan is the same international date format used in many other parts of the word: year, 

Japanese date conversion, Practically speaking, the only format used and understood in Japan is "year/​month/day" (e.g., 2018/6/21 or 18/06/21 ). So you don't have to let users choose.

Japanese Date in this format,

Comments
  • what is that actually, did you even try it?
  • 年 -> means year. 月 -> means month. 日-> means day.
  • The code works pretty well. Missing the day though? (thu) I'm guessing that means we'd have to have some sort of array with all the days in japanese that then get shown based on the day? $dys = array("日","月","火","水","木","金","土");
  • $dy = date("w"); $dys = array("日","月","火","水","木","金","土"); $dyj = $dys[$dy]; Is there a simpler way of adding this into the code?
  • The three can be combined to date('Y年m月d日')