The White Ghost (nimoloth) wrote in s2expressive,
The White Ghost

  • Music:

How To: Change The Date and Time Format

This can't be done with CSS - to do this you need to have a cutom layer or theme.

You need to change the lang_posted_by_date_and_time function, which is:

function lang_posted_by_date_and_time(EntryLite e, bool showposter, bool showdate, bool showtime) : string {
var string posted = "";
if ($showposter) {
var string posterstr = (defined $e.poster ? ""+$e.poster : """<i class="noposter">$*text_poster_anonymous</i>""");
if (not $showtime and not $showdate) {
return $posted;
if ($showdate and $showtime) {
if ($e.depth > 0) { # If $e is a comment
return $posted + $e->time_display("med", "");
} else {
return $posted + $e->time_display($*lang_fmt_date_med + " at %%h%%:%%min%% %%A%%M", "none");
if ($showdate and not $showtime) {
return $posted + $e->time_display("med", "none");
if (not $showdate and $showtime) {
return $e->time_display("none", "%%h%%:%%min%% %%A%%M");
return "";

In this, change these two lines:

return $posted + $e->time_display($*lang_fmt_date_med + " at %%h%%:%%min%% %%A%%M", "none");

return $posted + $e->time_display("med", "none");

, replacing $*lang_fmt_date_med with $*lang_fmt_date_med_day in the first and "med" with "med_day" in the latter.

This will give you the abbreviated day of the week at the start of the date and time. If you want the full day name, use $*lang_fmt_date_long_day and "long_day" respectively.

You can see all the date and time format options here.
Tags: $acct level:paid or perm, advanced, entries:timestamp, how to:instructions, s2:theme layer
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened