Hi,
I have a requirement where i need to compare the time stamp from source and Reference records and if the time stamp from the source is greater than Reference record, i need to pass the data.i am getting the time stamp from source and reference as '2011-07-21 03:24:46.000000 AM'.
When i gave the condition as Source time stamp>Reference Time Stamp, the condidtion is not satisfying and i am passing the records which i should not.Can anyone please help me in this issue .I tried to convert the Time stamp to Internal format by using Iconv but still not satisfying .
Thanks in Advance
Timestamp comparison
Moderators: chulett, rschirm, roy
If you have any control over the format of the timestamp from the source, make sure it is in military time. Strings just like you posted in 24 hour time will compare just fine.
Last edited by chulett on Fri Sep 02, 2011 2:47 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Show us every step... and you don't need to convert things twice. Heck, if you were successful in converting to 24 hour strings then (as I said) you can compare them directly.
Last edited by chulett on Fri Sep 02, 2011 2:49 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hi,
I have seen this kind of issue the apt solution is as follows.
Read the time value as string and convert the AM/PM by adding +12 to the existing value i.e you are converting the time to a 24 hour time frame
Note: The condition can only applied in stage variables using transformer.
And then do the necessary calculations.
There are so many posts available in DSXchange on converting AM/PM format to 24 Hour format. go through them for more detail explination of business logic.
Regards,
Sandeepgs
I have seen this kind of issue the apt solution is as follows.
Read the time value as string and convert the AM/PM by adding +12 to the existing value i.e you are converting the time to a 24 hour time frame
Note: The condition can only applied in stage variables using transformer.
And then do the necessary calculations.
There are so many posts available in DSXchange on converting AM/PM format to 24 Hour format. go through them for more detail explination of business logic.
Regards,
Sandeepgs
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
ISO 8601 prescribes the format of a timestamp.
If your timestamps conform to this format, then you don't need to to anything other than compare them with a ">" operator.
If your timestamps conform to this format, then you don't need to to anything other than compare them with a ">" operator.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.