Lasso Soft Inc. > Home

[lp_date_UTCtoLocal]

Linklp_date_UTCtoLocal
AuthorBil Corry
CategoryDate
Version8.x
LicensePublic Domain
Posted07 Dec 2005
Updated06 Sep 2006
More by this author...

Description

Converts a date from UTC/GMT timezone to server timezone.  Works around behavior in LP8.1.0 that will blindly convert dates without checking if already in local time (thus incorrectly shifting the time out of local time).

Sample Usage

var:'test' = lp_date_localtoUTC;
lp_date_UTCtoLocal: $test;
lp_date_UTCtoLocal: 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.

[

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

define_tag:'lp_date_UTCtoLocal',
	-description='Converts a date from UTC/GMT timezone to server timezone.',
	-priority='replace',
	-required='date';
	
	if: #date->type != 'date';
		#date = lp_date_stringtodate: (string: #date);
	/if;
	if: #date->gmt;
		return: (date_gmttolocal: #date);
	/if;
	return: #date;
/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