Link | excel_date |
Author | Dominique Guardiola Falco |
Category | Date |
Version | 8.5.x |
License | Public Domain |
Posted | 11 Nov 2010 |
Updated | 11 Nov 2010 |
More by this author... |
MS Excel uses a numeric format, called Serial Date format, when storing and dealing with dates and times. Serial date is calculated by taking a given date and determining the number of days that have passed since that date and 01-Jan-1900 (actually 00-Jan1900, but don't ask me, I don't know nothing about this).
//convert a serial date integer from an excel file to a lasso date date_format(excel2lasso_Date(40617),-format='%d/%m/%Y'); //convert a lasso date for inclusion in an excel file lasso2excel_Date(date('2011-03-15'));
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('excel2lasso_date', -required='s',-type='integer'); local('t') = date('1900-01-01'); local('d') = integer(#s - 2); local('result') = date(date_add(#t,-day=#d)); return(#result); /define_tag; define_tag('lasso2excel_date', -required='d',-type='date'); local('s') = date_difference(#d,'1900-01-01',-day); local('result') = integer(#s + 2); return(#result); /define_tag;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft