Showing results for 
Search instead for 
Did you mean: 

Converting TimeZones and XML Date Formats

Former Member
0 Kudos

Hi guys

I am using xMii 12.1 SP 5

I have a requirement to build and send xml messages to PI

The Format I need to specify in my message is


The format generate by defualt (using a date vairable) is


So you can see I have 2 problems

#1 - How do I convert my datetime to UTC time ? (I am currently +8GMT but obviously dont want to manually adjust for daylight savings)

#2 - How do i specify the expected format.?

Any/All suggestions would be appreciated.

I want to do all of the above within a transaction if possible, but I can potentially do an XSLTransform on my created message if necessary.


Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

You would need to create either a custom action or post to a jsp page to get the time difference. 12.2, currently in ramp up, does includes funtions for handling timezones. For jsp something like the following should work with the http post action...

<%@ page import = "java.util.*"%>
Calendar calendar = new GregorianCalendar();
int dtz = calendar.get(Calendar.HOUR_OF_DAY); 
out.println(calendar.get(Calendar.HOUR_OF_DAY) - dtz);