on 09-02-2010 4:31 AM
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
<CreationDateTime>2010-09-02T03:00:56.000Z</CreationDateTime>
The format generate by defualt (using a date vairable) is
<CreationDateTime>2010-09-02T11:00:56</CreationDateTime>
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.
Chris
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();
calendar.setTimeZone(TimeZone.getDefault());
int dtz = calendar.get(Calendar.HOUR_OF_DAY);
calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
out.println(calendar.get(Calendar.HOUR_OF_DAY) - dtz);
%>
Jamie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.