Lasso Soft Inc. > Home

[lp_date_UTCtimestamp]

Linklp_date_UTCtimestamp
AuthorBil Corry
CategoryDate
Version8.5.x
LicensePublic Domain
Posted18 Apr 2006
Updated03 Dec 2007
More by this author...

Description

Returns number of seconds since 1/1/1970 for UTC/GMT timezone.

Requires [lp_date_stringToDate] [lp_date_localtoUTC] [lp_date_serverDST]

Sample Usage

lp_date_UTCtimestamp;
'
'; lp_date_UTCtimestamp:'1/1/2006 12:00:00 GMT'; // at GMT '
'; 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.

[

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;

]

Related Tags

Comments

No comments

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