Link | tzconvert |
Author | Jolle Carlestam |
Category | Date |
Version | 9.x |
License | Public Domain |
Posted | 31 Aug 2011 |
Updated | 31 Aug 2011 |
More by this author... |
Method to set datetime values to specific timezones. Can also convert datetime values from the input timezone to the output.
NOTE Requires Lasso 9.1 or a late SVN patched version of Lasso 9.0 due to changes/fixes made to the date type
tzconvert(date, -tz_out = 'Australia/Sydney') '
' tzconvert(date_localtogmt(date),-tz_in = 'GMT', -tz_out = 'Australia/Sydney', -convert) '
' tzconvert(date, -tz_out = 'Australia/Sydney', -format = '%Q %T V', -convert) '
' tzconvert(date('2011-12-13 ' + date -> time), -format = '%Q %T V', -tz_out = 'Australia/Sydney', -convert) '
' tzconvert(date('2011-12-13 ' + date -> time), -format = '%-d %b %Y %H:%M:%S V', -tz_out = 'Australia/Brisbane', -convert) '
' tzconvert(date('2011-12-13 ' + date -> time), -format = '%-d %b %Y %H:%M:%S V', -tz_out = 'Australia/Darwin', -convert)
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.
timezone, output_timezone::string = 'GMT', format::string = '%Q %T', convert::boolean = false ) => { local(_date = date(#date -> format('%q'))) #_date -> timezone = #input_timezone local(zoneoffin = #_date -> ascopy -> zoneoffset) #zoneoffin += #_date -> ascopy -> dstoffset #_date -> timezone = #output_timezone local(zoneoffout = #_date -> ascopy -> zoneoffset) #zoneoffout += #_date -> ascopy -> dstoffset #convert ? #_date -> add(-millisecond = (#zoneoffout - #zoneoffin)) #_date -> setformat(#format) return #_date } define tzconvert( date::date, // input date -tz_in::string = #date -> timezone, -tz_out::string = 'GMT', -format::string = '%Q %T', -convert::boolean = false ) => tzconvert(#date, #tz_in, #tz_out, #format, #convert) ?>
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft