Skip to Content
avatar image
Former Member

Converting to UTC time format

Hi ,

I would like to convert the time retrieved from the database to UTC format. Do you have any idea how this possible in MII?

Is there any inbuilt method in MII for doing this



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 08, 2010 at 01:08 PM

    Hello Shaji,

    in my opinion a real time zone conversion cannot be achieved by using the MII functions and standard actions. I wrote my own MII action. It looks something like this:

    private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
    @Action(name = "TimeZoneConverter")
    @Outputs(names = { "OutputDate" }, types = { VariantDataTypes.STRING })
    public boolean run(IActionInstance action,
      @Input(name = "InputTimeZone") String inputTimeZone, 
      @Input(name = "InputDate") String inputDate,
      @Input(name = "OutputTimeZone") String outputTimeZone) 
      throws InvalidVariableException, DataConversionException {
      SimpleDateFormat inputDateFormat = new SimpleDateFormat(DATE_FORMAT);
      Date date = inputDateFormat.parse(inputDate);
      SimpleDateFormat outputDateFormat = new SimpleDateFormat(DATE_FORMAT);
      action.setActionResult("OutputDate", outputDateFormat.format(date));
      return true;



    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 07, 2010 at 11:39 AM


    you may google a bit to find possibilities to convert the time directly in your query. For example, if you use Oracle you may call [NEW_TIME|] function to convert a time to another timezone.

    Inside MII, the workbench offers some nice [Date functions|] you may use to get your UTC date from a given date. For example, add an amount of time to your date using datediffhours/datediffminutes etc.


    Add comment
    10|10000 characters needed characters exceeded