Welcome, Guest. Please
Login
or
Register
.
06/07/23 at 04:30:56
News:
"Breathtaking" (Check out the new MagicView release at
EccoTools.com
)
The eccoMAGIC Forums
›
the SLANG EXTENSION and Guest Programming
›
Slangmgh: Questions, Suggestions, Requests
(Moderator:
slangmgh
)
‹
Previous topic
|
Next topic
›
Pages: 1
Rating
Rate:
---
10 (best)
9
8
7
6
5
4
3
2
1
Rating:
Rating:
0.00
Votes:
0
5
4
3
2
1
5
4
3
2
1
1
2
3
4
5
6
7
8
9
10
Easy way to add / subtract hours (like "today()+X" for days) (Popularity: 7021 )
Philster
EccoMagic Apprentice
I Love Ecco!
Posts: 9
Easy way to add / subtract hours (like "today()+X" for days)
02/02/08 at 02:09:36
Say, "now()+5
h
" would add 5 hours to the current time, also changing the date if it goes beyond midnight / new year etc. Subtracting should work the same way.
I know this can probably be done through string manipulation in some way, but I'm sure that would be rather complicated.
If anyone already has a script / expression that does this, could you please post it?
Many thanks
Phil
Back to top
IP Logged
Admin
Administrator
I love Ecco!
Posts: 133
Re: Easy way to add / subtract hours (like "today()+X" for days)
Reply
#1
-
02/02/08 at 16:31:59
check out the eccoWiki on the date expressions.
i think you can do it easily that way.
Back to top
The Administrator.
IP Logged
Philster
EccoMagic Apprentice
I Love Ecco!
Posts: 9
Re: Easy way to add / subtract hours (like "today()+X" for days)
Reply
#2
-
02/04/08 at 08:39:34
Thanks for your reply.
If you mean the below, it only goes down to the day level, so does not include hours. If you had something else in mind could you please be more specific / post a URL within the Wiki? Thanks. Phil
Relative date expression may be used to calulate a date in the future
* +(-)xd plus or minus "x" days (eg. +5d, -27d)
* +(-)xw plus or minus "x" weeks
* +(-)xm plus or minus "x" months
* +(-)xy plus or minus "x" years
* -2y9m 6w2d (calculates from "today")
Back to top
IP Logged
Admin
Administrator
I love Ecco!
Posts: 133
Re: Easy way to add / subtract hours (like "today()+X" for days)
Reply
#3
-
02/04/08 at 15:21:51
ok,
isolate the time portion of the date (if any)
20061002
0920
add the desired amount of time to it,
if is > 2400 then add 1 to date,
otherwise just make date equal to new value.
this is doable even as a simple rule, actually.
Back to top
The Administrator.
IP Logged
Pages: 1
The eccoMAGIC Forums
›
the SLANG EXTENSION and Guest Programming
›
Slangmgh: Questions, Suggestions, Requests
(Moderator:
slangmgh
)
‹
Previous topic
|
Next topic
›
Forum Jump:
-----------------------------
Notices
-----------------------------
- Welcome ! (About this Forum)
-----------------------------
Everything eccoMAGIC
-----------------------------
- eccoTools
- Issues, Comments, and Questions
- eccoMAGIC Bug Reports
- eccoMAGIC FEATURE REQUESTS
- Share Forms and Templates for MagicMerge, MagicView, etc.
-----------------------------
Ecco Tutorials, Tips and How-to Guides
-----------------------------
- How do I .....
- Beginner
- Advanced theory, practice and tips
- Ecco Templates, and Examples (no extensions required)
- Ecco with Linux / WINE
-----------------------------
the SLANG EXTENSION and Guest Programming
-----------------------------
- Slang Rules Scripts, Functions, Examples and HOW TO
=> Slangmgh: Questions, Suggestions, Requests
- Bug Reports for Slangmgh
-----------------------------
Ecco DDE & Add-On Programming tips, tricks, techniques (Learn & Share!)
-----------------------------
- DDE Interfacing with Ecco - How to...
-----------------------------
Group Projects in Progress
-----------------------------
- ECCO to PDA Port
-----------------------------
Forum Extras
-----------------------------
- Yahoo Forum Refuge
- Yahoo Forum Polls
- Ecco related Links
- Member Files !
-----------------------------
Comments, Suggestions, Problems & Discussion about the EM Forums
-----------------------------
- RE: The EM Forums
The eccoMAGIC Forums
» Powered by
YaBB 2.1
!
YaBB
© 2000-2005. All Rights Reserved.