Welcome, Guest. Please Login or Register.
eccoMAGIC Forums
04/25/24 at 02:34:33
Home Help Search Login Register


Pages: 1
Send Topic Print
  Rating
Rate:
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

How to add FINE DETAIL TIME STAMP as text folder entry (Popularity: 3567 )
Admin
Administrator
*****


I love Ecco!

Posts: 134
Show the link to this post How to add FINE DETAIL TIME STAMP as text folder entry
08/25/16 at 04:52:39
 

 
*copied from JS's ecco_pro yahoo forum post at  
 
https://groups.yahoo.com/neo/groups/ecco_pro/conversations/topics/16516?reverse=
1 *

 
 
 
Let’s assume you have a text folder EditTimeTxt, you may use the following rule to assign a current time to it: (it does not matter in which folder you put it, e.g. I keep all rules in Rules folder).
 
Code:
++:L:
set_folder_value('EditTimeTxt', itemid, os.date('%Y%m%d %H%M %S', os.time())) 


 
 
The above rule will change the time value each time you change the item. If you wish to keep an item creation time instead or in addition to a last edit time, you may use the following rule:
 
Code:
++:L:
if get_folder_value('CreateTimeTxt', itemid) =='' then
    set_folder_value('CreateTimeTxt', itemid, os.date('%Y%m%d%H%M %S', os.time()))
end
  


 
 
flag L means that the rule is a Lua script
os.time() -- without arguments returns the current system time
os.date() – converts time into string
'%Y%m%d%H%M %S' – stands for Year, month, day, hours, minutes, seconds
set_folder_value() -- does what its name says
itemid -- means current item
if value=='' then -- checks if the folder has no value and only then assign a value to the folder
 

Back to top
 
 

The Administrator.
WWW   IP Logged
Pages: 1
Send Topic Print