Add token for site's UNIX timestamp
rkj - April 23, 2008 - 15:44
| Project: | Token |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
For comparison purposes (e.g. using workflow-ng's numeric comparison) it might be useful to have a token for the site's UNIX timestamp.
This very short and clean patch adds this token (called site-timestamp) to the token module.
Cheers,
Remco
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| token-timestamp.patch | 843 bytes | Ignored | None | None |

#1
Hi,
Thanks for submitting this patch. I'm also wanting this to be added in though the version i'd like it added to is 6.x-1.x. Before this patch will be applied i'm pretty sure they'll want the equals sign '=' characters to line up above it. Could you reroll the patch for that?
Also, have a look at the use of the format_date() function in the patch i'm attaching for the D6 version. Since it's already being used in the D6 version perhaps you can backport all the other tokens (if they aren't already).
I'm going to bump it to the D6 version and then we can backport to the D5 version.
IMPORTANT: This token is needed for publishing and unpublishing nodes using rules.
#2
This no longer applies...can you re-roll for 6.x-1.x-dev?
#3
Actually...maybe hold off for a little bit while I work on another token extras module...
#4
@greggles: Not sure what you're doing over there but it applies for me. :p
sammys@pie:~/sites/all/modules/token$ patch --dry-run -p0 < 250261_200903121611+1100.patch
patching file token.module
sammys@pie:~/sites/all/modules/token$ cvs stat token.module
===================================================================
File: token.module Status: Up-to-date
Working revision: 1.7.4.9
Repository revision: 1.7.4.9 /cvs/drupal-contrib/contributions/modules/token/token.module,v
Commit Identifier: 7bfe48b814034567
Sticky Tag: DRUPAL-6--1 (branch: 1.7.4)
Sticky Date: (none)
Sticky Options: (none)
This being a system level token doesn't it make sense for it to be in the main token module?
#5
Ok now that's weird... All those bits have been removed from 1.11. I'll let you get on with it!
#6
Fixed in #437842: create a token starterkit module and documentation so people know how to use it.
If you can review that and make sure it works that would be great. Thanks!
#7
@greggles: The starterkit module is a good idea as tokens can be daunting for noobs. However, adding the timestamp token to it means you have to install the starterkit module in order to make available a site-wide token. It doesn't make sense to do that since it's an example module and the timestamp is a valid non-example token.
#8
@sammys - I definitely see where you're coming from and struggled with this point for a bit. Ultimately, though, there is a penalty in UI and performance to jamming every last token into token core so token starter kit is a combination of "help noobs" and "random, less useful token dumping ground."
We can argue which tokens are more or less important for a long time - so far I'm going to use my best sense of it. Having two people request this feature over the 2 years since token was created ranks it pretty low in importance, in my opinion.
#9
Yep ok. Thanks for the info.
#10
Automatically closed -- issue fixed for 2 weeks with no activity.