S2:Date/DateTime

From No LJ Ads Wiki

Jump to: navigation, search

Child class of Date. Represents both a date and time.

S2 - Date

[edit] Members

int day Day; 1-31.
int hour Hour; 0-23.
int min Minute; 0-59.
int month Month; 1-12.
int sec Second; 0-59.
int year Year; 4 digits.

[edit] Methods

compare(Date d) : int Compare two dates. Returns a negative number if d is before the subject in time, positive if it is after, or zero if the two dates are equal. When comparing a Date with a DateTime, the time on the bare Date value is assumed to be midnight.
compare(DateTime d) : int Compare two dates. Returns a negative number if d is before the subject in time, positive if it is after, or zero if the two dates are equal. When comparing a Date with a DateTime, the time on the bare Date value is assumed to be midnight.
date_format() : string Returns date formatted as normal. // SeeAlso: siteapi.core1.dateformats
date_format(string fmt) : string Returns date formatted as indicated by fmt. One of: short, med, long, med_day, long_day. Or a custom format. Default is 'short'. // SeeAlso: siteapi.core1.dateformats
day_of_week() : int Returns the day of the week this date falls on, from Sunday=1 to Saturday=7
time_format() : string Returns time formatted as normal. // SeeAlso: siteapi.core1.dateformats
time_format(string fmt) : string Returns time formatted as indicated by fmt, or normal if blank. // SeeAlso: siteapi.core1.dateformats