Link | lp_date_offsetToUTC |
Author | Bil Corry |
Category | Date |
Version | 8.x |
License | Public Domain |
Posted | 26 Feb 2006 |
Updated | 06 Sep 2006 |
More by this author... |
Returns the date at UTC/GMT given a date with a specified timezone offset.
Requires [lp_date_stringtodate] [lp_string_getnumeric] [lp_date_stringtoOffset]
(lp_date_offsetToUTC: (date:'2/20/2006 7:00:00'), '-0500'); // returns 02/20/2006 12:00:00 GMT
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_offsetToUTC', -description='Returns the date at UTC/GMT given a date with a specified timezone offset.', -priority='replace', -required='date',-copy, -required='timezone_offset'; if: #date->type != 'date'; #date = lp_date_stringtodate: (string: #date); /if; #date = (lp_date_utcToLocal: #date); local:'offset' = (lp_date_stringToOffset: #timezone_offset, -map); local:'hour' = #offset->(find:'hours'); local:'minute' = #offset->(find:'minutes'); if: (string:#timezone_offset)->(contains:'-'); #minute *= -1; /if; #hour *= -1; #minute *= -1; #date = (date_add: #date, -hour=#hour, -minute=#minute); // add UTC/GMT marker #date = (date: #date->month '/' #date->day '/' #date->year ' ' #date->hour ':' #date->minute ':' #date->second ' GMT'); return: #date; /define_tag; ]
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft