Results 1 to 2 of 2

Thread: [Answers] Date

Threaded View

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] 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.




    All topics in [Answers] alphabetically: http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2015-04-27 at 05:07.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us