>Can I operate directly to a datetime() with using numeric to characters transformations ?
>
>For example:
>
>store datetime() to my datime
>
>Sum 40 mintures to myDatetime
>
>Sum 2 hours to myDatetime
>
>Moises
Yes. Just remember that you are adding seconds, not days as with date values.
To add 40 minutes, add 40 * 60.
To add 2 hours, add 2 * 60 * 60.
I suggest you use descriptive constants, like this:
#DEFINE SECONDS_PER_MINUTE 60
#DEFINE SECONDS_PER_HOUR 3600
#DEFINE SECONDS_PER_DAY 86400
? datetime() + 40 * SECONDS_PER_MINUTE
? datetime() + 2 * SECONDS_PER_HOUR
Of course, the value of the constant won't change in the foreseeable future, but that way, you can search for this specific usage of "60" in your code.
The constants would be included in some global header file.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)