Skip to main content
Ground Control | Tier 1
August 26, 2022
Question

How do I create a DateTime variable with a default value of 10:00 AM for the time, and a a default value of [today] (i.e. today's date, whatever that happens to be on the day I wish to use the variable) for the date. See attached.

  • August 26, 2022
  • 3 replies
  • 362 views

How do I create a DateTime variable with a default value of 10:00 AM for the time, and a a default value of [today] (i.e. today's date, whatever that happens to be on the day I wish to use the variable) for the date. The Edit Variable function will only allow me to set a default value for either BOTH the Date and the Time, or neither the Date and the Time. I want to set the default value for ONLY the Time four use on any day I use the variable.

See attached.

    3 replies

    Ashwin A.K
    Navigator | Tier 3
    August 28, 2022

    Hi @Gregory Winkeleer​ ,

     

    Could you give this a try and let us know if that works out for you?

     

    image 

    I've converted the string into datetime by concatenating the System Variable $SystemVariablePackage:CurrentDate$ which can be accessed from intellisense and 10:00 AM before passing it into the DateTime: Assign Action.

     

    As for the format, I've selected Custom Format and passed this in:

    MM-dd-yyyy hh:mm a

     

    If you want to be more specific with the datetime, then here is a list of DateTime Formats currently supported by Automation Anywhere.

     

    Kind Regards,

    Ashwin A.K

    Blogs at TheCodingTheory - https://www.thecodingtheory.com
    Lisa Wingebach
    Navigator | Tier 3
    August 29, 2022

    Hi @Gregory Winkeleer​,

     

    See if the following works for you:

     

    imageimageimageimage 

    All the best,

    Lisa

    Cadet | Tier 2
    September 27, 2024

    Hi @Gregory Winkeleer​,

     

    See if the following works for you:

     

    imageimageimageimage 

    All the best,

    Lisa

    Hi @Gregory Winkeleer​,

     

    See if the following works for you:

     

    imageimageimageimage 

    All the best,

    Lisa

    This works (Y)