lp_date_UTCtimestamp;
'<br>';
lp_date_UTCtimestamp:'1/1/2006 12:00:00 GMT'; // at GMT
'<br>';
lp_date_UTCtimestamp:'1/1/2006 12:00:00'; // at your timezone
Source Code
Click the "Download" button below to retrieve a copy of this tag,
including the complete documentation and sample usage shown
on this page. Place the downloaded ".inc" file in your
LassoStartup folder, restart Lasso, and you can begin using this
tag immediately.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[
define_tag:'lp_date_UTCtimestamp',
-description='Returns number of seconds since 1/1/1970 for UTC/GMT timezone.',
-priority='replace',
-optional='date', -copy;
// tested against http://www.onlineconversion.com/unix_time.htm
if: !(local_defined:'date');
local:'date' = date;
/if;
if: #date->type != 'date';
#date = lp_date_stringtodate: (string: #date);
/if;
#date = (lp_date_localtoUTC: #date);
return: (#date - '1970-01-01 00:00:00 GMT')->Seconds;
/define_tag;
]