aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2003-09-06 19:58:05 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2003-09-06 19:58:05 +0000
commit77853370867f36c67a21795a8731cc86182846ee (patch)
treefcbfe7975bbe673df0c68ede0d941b55e532e096 /src
parent2cd680aea096989e80e20a3cc9391df566fe7146 (diff)
added wini's patch for retrieving the weekday, the day-of-year and the daylight-saving flag
svn path=/trunk/externals/zexy/; revision=932
Diffstat (limited to 'src')
-rw-r--r--src/z_datetime.c11
1 files changed, 10 insertions, 1 deletions
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");
}