Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ with your query.

Display Date in "YYYYMMDD" Format

vinilnarayanvinilnarayan Members
edited February 2014 in Sahi - Open Source
Hi all...

I want to store system current date in a variable. and the date format should be in "YYYYMMDD". Plz help...


  • Hi..

    As I tried

    function yyyymmdd()
    var $year;
    var $month;
    var $month1;
    var $today;
    var $icrdate;
    var $fullyear;

    $icrdate = new Date();

    $month = $icrdate.getMonth();
    $month1 = parseInt($month);
    $month1 = $month1 + 1;
    $month = $month1;
    if ($month < 10)
    $month = "0" + $month;
    $today = $icrdate.getDate();
    if ($today < 10)
    $today = "0" + $today;

    return $datum;

    But i need a simple way to do this....
  • Its working .. Thank you :)
Sign In or Register to comment.