Anonymous_User Absent Member.
Absent Member.
264 views

setDeviceEventTime and IST


I am having a problem with events that have IST timezone and the date.js
lib. How have others converted the date to soemthing that works, or
have you modified the date.js lib? Here is my date string going into
it. "Wed 06 Jul 2011 09:57:47 AM IST"

Even using the datejs.com website I can see that is not valid, is I
change the IST to PST it works. I also tried to add an entry in the
date.js lib for IST but that also didnt work.

Here is how I am calling it. I have confirmed Date contains the string
I posted above.
this.dt = new Date(splitline["Date"]);
e.setDeviceEventTime(this.dt);

dt is just set to "Invalid Date" and the event errors out.

Work around suggestions?


--
cslye
------------------------------------------------------------------------
cslye's Profile: http://forums.novell.com/member.php?userid=26909
View this thread: http://forums.novell.com/showthread.php?t=441644

0 Likes
1 Reply
Anonymous_User Absent Member.
Absent Member.

Re: setDeviceEventTime and IST


Hi there,

My first guess would be that 'IST' is ambiguous and has no set meaning.
IST can mean any of:
IST Israel Standard Time Asia UTC + 2 hours
IST India Standard Time Asia UTC + 5:30 hours
IST Irish Standard Time Europe UTC + 1 hour

Most likely date.js punts when there are conflicts of this sort.

It's far preferable to use the 'long' TZ labels like
"Americas/New_York", but unfortunately I don't think Javascript (and
hence date.js) knows about them. Second would be a true offset like
-0530.

I should mention, however, that if you're trying to set one of the
*Time fields in Sentinel, however, you're probably doing the wrong
thing. The preferred approach is to treat the input as local time, and
let the Event.send() method do your timezone conversion for you. You do
this by simply setting the rec.s_TimeZone field to the timezone of your
source, which can be from the Event Source node in ESM or from the event
data. Event.send() understands long and short timezone labels (it uses
Java under the hood) as well as offsets, although I suspect just like
date.js it will punt if the label is not unique.

This is all documented here:
http://www.novell.com/developer/collector_dates.html


--
DCorlette
------------------------------------------------------------------------
DCorlette's Profile: http://forums.novell.com/member.php?userid=4437
View this thread: http://forums.novell.com/showthread.php?t=441644

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.