Sounds like you're getting the picture, but just to clarify as you requested...
All data in an AB PLC is retentive. If you power down the PLC, whatever values were in each tag at the moment you power it down is still there when you power it back up. So, let's say you have some logic that keeps track of the current date and time. If your PLC shuts down at 1/1/2019, 12:34am, then when it starts back up - no matter how much time passes in between - the tags that stored those date and time values will still read 1/1/2019 12:34am. All you need to do is write some code so that on first scan, you copy those tags to a holding register, called, say "Shutdown_DateTime". The important thing is that this copy happens before the code that updates the PLC's date and time.
So you'd have three rungs in the PLC, each preceded by an S:FS instruction, and in the following order:
1. Copy the current date/time to a "Shutdown_DateTime" tag
2. Update "Current_DateTime" from the controller's internal clock
3. Calculate the time difference between Shutdown_DateTime and Current_DateTime
You could put them all on one rung with just one S:FS bit, with the three steps on three different branches. As long as they're in that order, it'll work. And then the whole task is in the same place and you can put a rung comment explaining what's going on.
All data in an AB PLC is retentive. If you power down the PLC, whatever values were in each tag at the moment you power it down is still there when you power it back up. So, let's say you have some logic that keeps track of the current date and time. If your PLC shuts down at 1/1/2019, 12:34am, then when it starts back up - no matter how much time passes in between - the tags that stored those date and time values will still read 1/1/2019 12:34am. All you need to do is write some code so that on first scan, you copy those tags to a holding register, called, say "Shutdown_DateTime". The important thing is that this copy happens before the code that updates the PLC's date and time.
So you'd have three rungs in the PLC, each preceded by an S:FS instruction, and in the following order:
1. Copy the current date/time to a "Shutdown_DateTime" tag
2. Update "Current_DateTime" from the controller's internal clock
3. Calculate the time difference between Shutdown_DateTime and Current_DateTime
You could put them all on one rung with just one S:FS bit, with the three steps on three different branches. As long as they're in that order, it'll work. And then the whole task is in the same place and you can put a rung comment explaining what's going on.