18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Date format

arunbalaarunbala Members
edited November -1 in Sahi - Open Source
Hi narayan,
How can i get the system date in the following format "Feb 08,2012". And i just want to compare this date with two increamental days, mean Feb 10,2012.

Pls reply.

Comments

  • Hi arunbala,

    1. You can get the system date in the format "Feb 08,2012", by using
    var $formattedDate = new java.text.SimpleDateFormat("MMM dd,yyyy").format(new java.util.Date());
    

    2. Since Sahi is based upon the Javascript, You can use Javascript Date Object to perform comparison of two dates.Go through the following link,

    http://www.ezineasp.net/post/Javascript-Convert-String-to-Date.aspx

    This might help you.

    Regards,
    Theeran.
Sign In or Register to comment.