[lp_date_localtoUTC]

Description

Link: [lp_date_localtoUTC]
Author: Bil Corry
Category: Date
Version: 8.x
License: Public Domain
Posted: Dec. 02, 2005
Updated: Sep. 06, 2006
More by this author...
Converts a date from server timezone to UTC/GMT timezone.  Works around behavior in LP8.1.0 that will blindly convert dates without checking if already in UTC/GMT time (thus incorrectly shifting the time out of UTC/GMT).

Parameters

-date date, optional The date to be converted to UTC/GMT time. Default is to use the current date/time.

Sample Usage

lp_date_localtoUTC: date;
						

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
19
20
21
22
[

// works around behavior in LP8.1.0 that will blindly convert dates without checking if already in UTC/GMT time

define_tag:'lp_date_localToUTC',
	-description='Converts a date from server timezone to UTC/GMT timezone.',
	-priority='replace',
	-optional='date';
	
	if: !(local_defined:'date');
		local:'date' = date;
	/if;
	if: #date->type != 'date';
		#date = lp_date_stringtodate: (string: #date);
	/if;
	if: #date->gmt;
		return: #date;
	/if;
	return: (date_localtogmt: #date);
/define_tag;

]

 

Related Tags



Comments

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net