Results 1 to 5 of 5

Thread: How to send value date today ?

  1. #1

    Thread Starter
    Registered User
    Join Date
    Feb 2021
    Posts
    2

    How to send value date today ?

    I want to sent value date today replace in 10.02.2021.
    Please guide me about it.

    session.findById("wnd[3]/AAA").text = "10.02.2021"

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,749

    Re: How to send value date today ?

    For future reference, here's where to ask VBA questions...

    https://www.vbforums.com/forumdispla...ce-Development

  3. #3
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    10,013

    Re: How to send value date today ?

    Moderation action: moved to office development

  4. #4
    Lively Member
    Join Date
    Jan 2020
    Posts
    121

    Re: How to send value date today ?

    Use new Date() to generate a new Date object containing the current date and time.

    Code:
    var today = new Date();
    var dd = String(today.getDate()).padStart(2, '0');
    var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
    var yyyy = today.getFullYear();
    
    today = mm + '/' + dd + '/' + yyyy;
    document.write(today);

    This will give you today's date in the format of mm/dd/yyyy.
    Simply change today = mm +'/'+ dd +'/'+ yyyy; to whatever format you wish.

    For more information follow this link
    Reference:https://stackoverflow.com/a/4929629/11954917

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    23,749

    Re: How to send value date today ?

    @Prahlad - itís bad practice using m to refer to Month. In VB date formatting m refers to minute and M refers to Month, as h refers to 12 hour clock and H refers to 24 hour clock...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width