[Top]
Calendar
Calendar.YMD
Calendar.YMD.YMD
|
Method Calendar.YMD.YMD()->second_no()
- Method
second_no
float fraction_no()
int hour_no()
int julian_day()
int leap_year()
int minute_no()
int month_day()
int month_no()
int second_no()
int utc_offset()
int week_day()
int week_no()
int year_day()
int year_no()
string month_name()
string month_shortname()
string month_day_name()
string week_day_name()
string week_day_shortname()
string week_name()
string year_name()
string tzname()
string tzname_iso()
- Description
-
function method int unix_time()
Returns the unix time integer corresponding to the start
of the time range object. (An unix time integer is UTC.)
function method datetime()
This gives back a mapping with the relevant
time information (representing the start of the period);
([ "year": int // year number (2000 AD=2000, 1 BC==0)
"month": int(1..) // month of year
"day": int(1..) // day of month
"yearday": int(0..) // day of year
"week": int(1..) // week of year
"week_day": int(0..) // day of week
"timezone": int // offset to utc, including dst
"unix": int // unix time
"julian": int // julian day
// for compatibility:
"hour": 0 // hour of day, including dst
"minute": 0 // minute of hour
"second": 0 // second of minute
"fraction": 0.0 // fraction of second
]);
- Note
-
Day of week is compatible with old versions,
ie, 0 is sunday, 6 is saturday, so it shouldn't be
used to calculate the day of the week with the given
week number. Year day is also backwards compatible,
ie, one (1) less then from the year_day() function.
If this function is called in a Week object that begins with
the first week of a year, it returns the previous year if that
is where the week starts. To keep the representation
unambiguous, the returned week number is then one more than
the number of weeks in that year.
E.g. Week(2008,1)->datetime() will return year 2007 and week
53 since the first week of 2008 starts in 2007.
|