help-glpk
[Top][All Lists]
Advanced

[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.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]