I have the following hook in my NodeUp and an equivalent in my node down. Apart from it being the longest way of doing this (first one I found when searching), I get a strange result.
Everything is correct - except - the month is out by 1. It reports month as being last month, not this month. I know the local time is correct(or bein extracted correctly) because I am comparing the Node_Up and Node_Down event times to the custom attributes - and everything matches - exactly - except the month - which is out by one.
SetCustomAttribute($node, "timelastcameup",localtime(time())->mday.".".localtime(time())->mon.".".localtime(time())->year.", ".localtime(time())->hour.":".localtime(time())->min.":".localtime(time())->sec);
Any ideas?
Everything is correct - except - the month is out by 1. It reports month as being last month, not this month. I know the local time is correct(or bein extracted correctly) because I am comparing the Node_Up and Node_Down event times to the custom attributes - and everything matches - exactly - except the month - which is out by one.
SetCustomAttribute($node, "timelastcameup",localtime(time())->mday.".".localtime(time())->mon.".".localtime(time())->year.", ".localtime(time())->hour.":".localtime(time())->min.":".localtime(time())->sec);
Any ideas?