[7.3.5] Get Today's Time With Given Format

Home Forums Convertigo developers Forums as moved to Stack Overflow. [7.3.5] Get Today's Time With Given Format

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #131957

    fengclark
    Participant

    Hello,

    I am curious about what is the best way to get the current time in Convertigo.
    For example, I want to get current time in one Sequence with following steps:

    1. Get current time as “currentTime” (real time)
    2. Change its format to MM/yyyy (for example)
    3. Get “currentTimeLastMouth” & “currentTimeNextMouth”

    My question is to achieve the third step, what tool should I use (step/SequenceJS) ?

    If SequenceJS, can I use native JS Date() Object ?
    Because if “currentTime” is 01/1988, we can’t do a simple plus/minus.
    (calendar.add(Calendar.MONTH, -1) in JAVA with Class Calendar)
    “currentTimeLastMouth” will be 12/1987

    Thank you in advance,

    #132017

    admin
    Keymaster

    Hello

    You are absolutly right, You can use a Sequence_JS to get the current date using the Date() js object.
    Anything you can do with the JS Date object is supported in Convertigo.

    See http://www.w3schools.com/jsref/jsref_obj_date.asp

    Hope That Helps
    Convertigo Support Team.

    #132018

    fengclark
    Participant

    Thank you for this quick answer 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.