hello,
i am tried to do conversion from military format to standard format.
the job design is
db2 stage...........xfm..................oracle
The source column datatype is char and want to load according to standard time format. The target column datatype is varchar.
the current format is 22.48.51 but in output required 10:48:51 PM
i tried by string to time conversion but not works.
Can you please help me on this.
military to standard time conversion
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Convert the inbound string to a time using StringToTime() with an appropriate format specification (such as "%hh.%nn.%ss").
Wrap that result in a TimeToString() function with a format string that specifies your desired output format.
Wrap that result in a TimeToString() function with a format string that specifies your desired output format.
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.
Code for implementing Ray's suggestion is:
where INLink.INTIME is incoming time.
Code: Select all
TimeToString(StringToTime(INLink.INTIME,"%hh:%nn:%ss"),"%HH:%nn:%ss %aa")
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
And in case you are unfamiliar with the Chinese Proverb:
"If you give a man a fish you feed him for a day. If you teach a man to fish you feed him for a lifetime."
We generally prefer to teach fishing around here rather than simply hand out fish.
"If you give a man a fish you feed him for a day. If you teach a man to fish you feed him for a lifetime."
We generally prefer to teach fishing around here rather than simply hand out fish.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers