[lp_date_UTCtimestamp]

Description

Link: [lp_date_UTCtimestamp]
Author: Bil Corry
Category: Date
Version: 8.5.x
License: Public Domain
Posted: Apr. 18, 2006
Updated: Dec. 03, 2007
More by this author...

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

Requires [lp_date_stringToDate] [lp_date_localtoUTC] [lp_date_serverDST]

Parameters

-date date, optional The date to use for the timestamp.

Sample Usage

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;

]

 

Related Tags



Comments

none

Email:


Password:



Newest

Most Popular