Lasso Soft Inc. > Home

[c5_unixtimestamp]

Linkc5_unixtimestamp
AuthorJason Huck
CategoryDate
Version8.x
Licensehttp://opensource.org/licenses/artistic-license.php
Posted16 Jan 2006
Updated16 Jan 2006
More by this author...

Description

Returns the current unix timestamp (milliseconds since Jan 01, 1970 GMT).

Sample Usage

[c5_unixtimestamp]

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.

define_tag(
	'unixtimestamp',
	-namespace='c5_',
	-description='Returns the current unix timestamp (milliseconds since Jan 01, 1970 GMT).'
);
	local('startTime') = date('1970-01-01 00:00:00 GMT');
	local('out') = date_localtogmt(#startTime)->difference(date, -second);
	date->dst ? #out -= 3600;
	return(#out);
/define_tag;

Related Tags

Comments

11 Aug 2008, Robert Newcomb

Doesn't work for me in 8.1

Though I placed the .inc file in where indicated, and restarted Lasso, a call to the tag returns an error, that the tag is unknown.

Ideas on what to look for?

17 Mar 2006, Jason Huck

Works here.

I even downloaded a fresh copy to verify. Perhaps it has something to do with locale?

16 Mar 2006, Pier Kuipers

Doesn't seem to work

Sorry Jason, when I try to run this tag I get an error:
No tag, type or constant was defined under the name null->difference with arguments: array: (03/16/2006 15:54:55), (-second)
at: unixtimestamp
Just thought I'd try your tag before adding my own :-)
Pier

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft