S2 Cookbook: Dates

The two classes involved with dates are Date, which represents a date, and DateTime, which represents both a date and time.

Getting the current date or time
The function you use for this is journal_current_datetime, which returns the current DateTime in the timezone of the journal being viewed.

Getting the day of the week
The Date and DateTime classes both have a function called day_of_week. It returns an integer between 1 and 7, where Sunday starts at 1 and Saturday ends at 7. You can then get the name of the day from one of several properties:


 * lang_dayname_long -- Array containing the long name of the day: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
 * lang_dayname_short -- Array containing day abbreviations: Sun, Mon, Tue, Wed, Thu, Fri, Sat
 * lang_dayname_shorter -- Array containing day letters: S, M, T, W, T, F, S