[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Time conversion functions
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Time conversion functions |
Date: |
Fri, 21 Nov 2008 07:09:57 +0300 |
> Can you add a DayOfWeek(t) which returns a number 0 to 6, with 0=Sunday,
> 1=Monday, etc.
Yes.
However, to minimize the number of functions I think it would be better
to have one function, say, tmfunc(t, what), which returns a component
of the broken-down time specified by its second argument. For example:
tmfunc(t, "d") returns the day of the month, 1 to 31
tmfunc(t, "w") returns the day of the week, 0 to 6 (0 = Sunday)
tmfunc(t, "u") returns the day of the week, 1 to 7 (1 = Monday)
tmfunc(t, "V") returns the week number according to ISO 8601
etc.
> Personally, I prefer the way that Excel and many other packages model
> time: It is the number of days (as a 64-bit "real" number) from some
> base time, so 0.5 represents 12 hours from the base time. It makes
> differences very easy to calculate.
- [Help-glpk] Time conversion functions, xypron, 2008/11/17
- RE: [Help-glpk] Time conversion functions, Meketon, Marc, 2008/11/18
- Re: [Help-glpk] Time conversion functions, Andrew Makhorin, 2008/11/18
- Re: [Help-glpk] Time conversion functions, xypron, 2008/11/18
- Re: [Help-glpk] Time conversion functions, Andrew Makhorin, 2008/11/19
- Re: [Help-glpk] Time conversion functions, Xypron, 2008/11/19
- Re: [Help-glpk] Time conversion functions, Andrew Makhorin, 2008/11/20
- RE: [Help-glpk] Time conversion functions, Meketon, Marc, 2008/11/20
- Re: [Help-glpk] Time conversion functions,
Andrew Makhorin <=
- Re: [Help-glpk] Time conversion functions, xypron, 2008/11/21
- RE: [Help-glpk] Time conversion functions, xypron, 2008/11/21
- RE: [Help-glpk] Time conversion functions, Meketon, Marc, 2008/11/21
- Re: [Help-glpk] Time conversion functions, Maurice Diamantini, 2008/11/21
- Re: [Help-glpk] Time conversion functions, xypron, 2008/11/21
- Re: [Help-glpk] Time conversion functions, Andrew Makhorin, 2008/11/21
- Re: [Help-glpk] Time conversion functions, xypron, 2008/11/21
- Re: [Help-glpk] Time conversion functions, Andrew Makhorin, 2008/11/21
- Re: [Help-glpk] Time conversion functions, xypron, 2008/11/21
- Re: [Help-glpk] Time conversion functions, xypron, 2008/11/21