Date

Here’s an example that returns DD/MM/YY – I’m calling it from the click of a commandbutton in a canvas section. My function is just in the section custom library here.

Code:
function formatDate(d) {
  var dd = d.getDate();
  if ( dd < 10 ) dd = '0' + dd;
   var mm = d.getMonth()+1;
  if ( mm < 10 ) mm = '0' + mm;
  var yy = d.getFullYear() % 100;
  if ( yy < 10 ) yy = '0' + yy;
return dd+'/'+mm+'/'+yy;

}
////////////////////////////////////////////////////////////////
// Event delegate for 'click' event
function page1_section1_field1_click()
{
        var currentdate = new Date();
        messagebox(formatDate(currentdate));
}


Lianja dates start at 1/1/1900.



The TTOC() function is used to format datetimes.
I have enhanced it in v1.3Beta6 to handle ISO 8601. See below.

Screen Shot 2014-11-25 at 1.24.45 PM

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s