WordPress.org

Ready to get started?Download WordPress

Forums

How do I change year? (10 posts)

  1. rhino
    Member
    Posted 7 years ago #

    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

  2. moshu
    Member
    Posted 7 years ago #

    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.

  3. rhino
    Member
    Posted 7 years ago #

    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

  4. moshu
    Member
    Posted 7 years ago #

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

  5. koeln
    Member
    Posted 7 years ago #

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

    Edited:
    Yes
    http://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).

  6. moshu
    Member
    Posted 7 years ago #

    Of course, it's NOT the same... otherwise they would call it Gregorian :)
    http://en.wikipedia.org/wiki/Thai_solar_calendar

  7. rhino
    Member
    Posted 7 years ago #

    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

  8. koeln
    Member
    Posted 7 years ago #

    Somebody just did an Gregorian Date to Jalali Date Converter for wordpress. Perhaps you can ask them which php-comments you to change
    http://codex.wordpress.org/Plugins/Calendar_Event

  9. Kafkaesqui

    Posted 7 years ago #

    If it's a simple math issue:

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

  10. rhino
    Member
    Posted 7 years ago #

    Kafkaesqui, thank you

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags