• We usually use the function “the_time” in order to display time on our blogs.

    My question is how do we change the display time, for example, This year is 2006, but I would like to display year as 2549. How do I do that?

    Regards,
    Lee

Viewing 9 replies - 1 through 9 (of 9 total)
  • Well, that post would NOT appear until the year 2549 will come.
    If that’s what you want > when writing post click the “Edit Timestamp” box and edit the year, month… time accordingly.

    Thread Starter rhino

    (@rhino)

    Sorry, it’s totally fault that i didn’t explain clearly.

    My meaning is that based on Thai calendar, this year is 2549 for Thai people on Thai calendar . When I posted blog on my WordPress, the year is shown as 2006, I would like to display it in Thai calendar that is 2549. However, I wouldn’t like to change anyting in the database.

    Regards,
    Lee

    I am afraid PHP doesn’t have support for the Thai calendar. You should check this on a PHP related forum/site.

    Is the Thai calendar the same than the Gregorian calendar (exc the year)? Or do you have different days and month, too?

    Edited:
    Yes
    https://en.wikipedia.org/wiki/Thai_solar_calendar

    You have to edit every time, mktime and edit the year before displaying. Just adding an integer won’t work (leap years).

    Of course, it’s NOT the same… otherwise they would call it Gregorian ??
    https://en.wikipedia.org/wiki/Thai_solar_calendar

    Thread Starter rhino

    (@rhino)

    Thank you for your comments,

    The different thing is that in Thai calendar, we have to add more 543, for example, this year is 2549 (2006+543)

    I’ve tried to edit the php script that was

    php the_time(‘jS F, Y’+534) or
    …..Y+534′)

    but it still doesn’t work

    Somebody just did an Gregorian Date to Jalali Date Converter for wordpress. Perhaps you can ask them which php-comments you to change
    https://codex.www.ads-software.com/Plugins/Calendar_Event

    If it’s a simple math issue:

    <?php
    $thai_year = get_the_time('Y') + 543;
    the_time('jS F, ' . $thai_year);
    ?>

    Thread Starter rhino

    (@rhino)

    Kafkaesqui, thank you

    your suggestion is very useful, now my calendar diplays the correct year properly in Thai ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How do I change year?’ is closed to new replies.