From 77853370867f36c67a21795a8731cc86182846ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Sat, 6 Sep 2003 19:58:05 +0000 Subject: added wini's patch for retrieving the weekday, the day-of-year and the daylight-saving flag svn path=/trunk/externals/zexy/; revision=932 --- src/z_datetime.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/z_datetime.c') diff --git a/src/z_datetime.c b/src/z_datetime.c index db2da5e..8f95fe1 100644 --- a/src/z_datetime.c +++ b/src/z_datetime.c @@ -118,6 +118,9 @@ typedef struct _date t_outlet *x_outlet1; t_outlet *x_outlet2; t_outlet *x_outlet3; + t_outlet *x_outlet4; + t_outlet *x_outlet5; + t_outlet *x_outlet6; } t_date; static void *date_new(t_symbol *s, int argc, t_atom *argv) @@ -135,6 +138,9 @@ static void *date_new(t_symbol *s, int argc, t_atom *argv) x->x_outlet1 = outlet_new(&x->x_obj, &s_float); x->x_outlet2 = outlet_new(&x->x_obj, &s_float); x->x_outlet3 = outlet_new(&x->x_obj, &s_float); + x->x_outlet4 = outlet_new(&x->x_obj, &s_float); + x->x_outlet5 = outlet_new(&x->x_obj, &s_float); + x->x_outlet6 = outlet_new(&x->x_obj, &s_float); return (x); } @@ -151,6 +157,9 @@ static void date_bang(t_date *x) gettimeofday(&tv, 0); resolvetime = (x->GMT)?gmtime(&tv.tv_sec):localtime(&tv.tv_sec); #endif + outlet_float(x->x_outlet6, (t_float)resolvetime->tm_isdst); + outlet_float(x->x_outlet5, (t_float)resolvetime->tm_yday); + outlet_float(x->x_outlet4, (t_float)resolvetime->tm_wday); outlet_float(x->x_outlet3, (t_float)resolvetime->tm_mday); outlet_float(x->x_outlet2, (t_float)resolvetime->tm_mon + 1); outlet_float(x->x_outlet1, (t_float)resolvetime->tm_year + 1900); @@ -159,7 +168,7 @@ static void date_bang(t_date *x) static void help_date(t_date *x) { post("\n%c date\t\t:: get the current system date", HEARTSYMBOL); - post("\noutputs are\t: year / month / day"); + post("\noutputs are\t: year / month / day / day of week /day of year / daylightsaving (1/0)"); post("\ncreation\t::'date [GMT]': show local date or GMT"); } -- cgit v1.2.1