Service Virtualization

 View Only
Expand all | Collapse all
  • 1.  Date format

    Posted Dec 06, 2023 04:33 PM

    I need to print a dynamic date in the virtual service response with the month specified in CAPs. I've used the code below, which displays the first letter in capital and the rest in lowercase; any recommendations would be greatly appreciated.

    Function : {{=doDateDeltaFromCurrent("dd-MMM-yyyy HH:mm:ss","-1M");/*14-08-2012 09:01:03*/}}
     
    Outcome : 06-Dec-2023 15:45:58
    Expected results : 06-DEC-2023 15:45:58


  • 2.  RE: Date format

    Broadcom Employee
    Posted Dec 06, 2023 05:51 PM
    Try:

    Function : {{=doDateDeltaFromCurrent("dd-MMM-yyyy
    HH:mm:ss","-1M").toUpperCase();/*14-08-2012 09:01:03*/}}

    Cheers,
    Danny

    --
    This electronic communication and the information and any files transmitted
    with it, or attached to it, are confidential and are intended solely for
    the use of the individual or entity to whom it is addressed and may contain
    information that is confidential, legally privileged, protected by privacy
    laws, or otherwise restricted from disclosure to anyone else. If you are
    not the intended recipient or the person responsible for delivering the
    e-mail to the intended recipient, you are hereby notified that any use,
    copying, distributing, dissemination, forwarding, printing, or copying of
    this e-mail is strictly prohibited. If you received this e-mail in error,
    please return the e-mail to the sender, delete it from your computer, and
    destroy any printed copy of it.




  • 3.  RE: Date format

    Posted Dec 07, 2023 03:58 PM

    Thanks Danny for quick turnaround , I tried the function that your shared but no luck , below is the sample response.

    <AddtlInf> {{=doDateDeltaFromCurrent("dd-MMM-yyyy HH:mm:ss","-1M").toUpperCase();/*14-DEC-2012 09:01:03*/}}</AddtlInf>




  • 4.  RE: Date format
    Best Answer

    Broadcom Employee
    Posted Dec 15, 2023 12:15 PM

    Try this {{="{{=doDateDeltaFromCurrent("dd-MMM-yyyy HH:mm:ss","-1M");/*14-DEC-2012 09:01:03*/}}".toUpperCase() }} 

    or 

    if you also need it to be a property {{reqDate = "{{=doDateDeltaFromCurrent("dd-MMM-yyyy HH:mm:ss","-1M");/*14-DEC-2012 09:01:03*/}}".toUpperCase() }}



    ------------------------------
    Karl M.
    DevOps Capability Specialist
    Broadcom
    ------------------------------



  • 5.  RE: Date format

    Broadcom Employee
    Posted Dec 19, 2023 02:18 AM
    Hi Karl,

    Did you get this suggestion to work on your system?

    When Vikram replied that my original suggestion didn't work I realized that
    we needed this double level of right-hand side bean-shell expression
    execution but I never got it to work.

    I thought it had to do with the fact that the doDateDelta function isn't
    java but a script function.
    But it could also be my environment and/or DevTest version because I don't
    have the issue that Vikram experiences (My months are in uppercase by
    default), hence my question if it works on your system.

    Cheers,

    Danny Saro

    Client Services Consultant

    Broadcom Software


    -------------------------------------------------

    --
    This electronic communication and the information and any files transmitted
    with it, or attached to it, are confidential and are intended solely for
    the use of the individual or entity to whom it is addressed and may contain
    information that is confidential, legally privileged, protected by privacy
    laws, or otherwise restricted from disclosure to anyone else. If you are
    not the intended recipient or the person responsible for delivering the
    e-mail to the intended recipient, you are hereby notified that any use,
    copying, distributing, dissemination, forwarding, printing, or copying of
    this e-mail is strictly prohibited. If you received this e-mail in error,
    please return the e-mail to the sender, delete it from your computer, and
    destroy any printed copy of it.




  • 6.  RE: Date format

    Broadcom Employee
    Posted Dec 19, 2023 08:46 AM
    HI Danny
    I tested Karls suggestion locally. It worked like a charm.

    --
    regards
    Sankar Natarajan

    --
    This electronic communication and the information and any files transmitted
    with it, or attached to it, are confidential and are intended solely for
    the use of the individual or entity to whom it is addressed and may contain
    information that is confidential, legally privileged, protected by privacy
    laws, or otherwise restricted from disclosure to anyone else. If you are
    not the intended recipient or the person responsible for delivering the
    e-mail to the intended recipient, you are hereby notified that any use,
    copying, distributing, dissemination, forwarding, printing, or copying of
    this e-mail is strictly prohibited. If you received this e-mail in error,
    please return the e-mail to the sender, delete it from your computer, and
    destroy any printed copy of it.




  • 7.  RE: Date format

    Broadcom Employee
    Posted Dec 19, 2023 09:25 AM
    Thanks Sankar,

    Ok, good to hear.

    I'm wondering then why not locally on my installation. Can you let me know
    your DevTest version?

    Cheers,

    Danny Saro

    Client Services Consultant

    Broadcom Software


    -------------------------------------------------

    --
    This electronic communication and the information and any files transmitted
    with it, or attached to it, are confidential and are intended solely for
    the use of the individual or entity to whom it is addressed and may contain
    information that is confidential, legally privileged, protected by privacy
    laws, or otherwise restricted from disclosure to anyone else. If you are
    not the intended recipient or the person responsible for delivering the
    e-mail to the intended recipient, you are hereby notified that any use,
    copying, distributing, dissemination, forwarding, printing, or copying of
    this e-mail is strictly prohibited. If you received this e-mail in error,
    please return the e-mail to the sender, delete it from your computer, and
    destroy any printed copy of it.




  • 8.  RE: Date format

    Broadcom Employee
    Posted Dec 19, 2023 10:36 AM
    Worked in 10.7.2 GA and SP4

    *Karl Miller*

    *mobile:* 720.636.4648
    Karl.Miller@broadcom.com

    Upcoming Out of Office: Dec 26 - 29


    On Tue, Dec 19, 2023 at 8:27 AM Danny Saro via Broadcom <mail@broadcom.com>
    wrote:

    > Thanks Sankar, Ok, good to hear. I'm wondering then why not locally on my
    > installation. Can you let me know your DevTest version? Cheers, ... -posted
    > to the "Service Virtualization" community
    > [image: Broadcom] </mail@broadcom.com>


  • 9.  RE: Date format

    Broadcom Employee
    Posted Dec 19, 2023 10:36 AM
    That Mar also has a test the VSM id demo-accounts
    *Karl Miller*

    *mobile:* 720.636.4648
    Karl.Miller@broadcom.com

    Upcoming Out of Office: Dec 26 - 29


    On Tue, Dec 19, 2023 at 9:35 AM Karl Miller <karl.miller@broadcom.com>
    wrote:

    > Worked in 10.7.2 GA and SP4
    >
    > *Karl Miller*
    >
    > *mobile:* 720.636.4648
    > Karl.Miller@broadcom.com
    >
    > Upcoming Out of Office: Dec 26 - 29
    >
    >
    > On Tue, Dec 19, 2023 at 8:27 AM Danny Saro via Broadcom <mail@broadcom.com>
    > wrote:
    >
    >> Thanks Sankar, Ok, good to hear. I'm wondering then why not locally on my
    >> installation. Can you let me know your DevTest version? Cheers, ... -posted
    >> to the "Service Virtualization" community
    >> [image: Broadcom] </mail@broadcom.com></karl.miller@broadcom.com>


  • 10.  RE: Date format

    Posted Jan 08, 2024 03:42 PM

    Thanks Karl for the suggestion, this worked perfectly fine.

    Request : {{="{{=doDateDeltaFromCurrent("dd-MMM-yyyy HH:mm:ss","-1M");/*14-DEC-2012 09:01:03*/}}".toUpperCase() }} 

    Response : 08-JAN-2024 15:39:59