i have source like
balance,drawtime
20000, 8.30
50000,10.20
3000,4.00
i want target like this
balance,drawtime
20000, 20.30
50000,22.20
3000,16.00
convert 12hrs as a 24hrs
Moderators: chulett, rschirm, roy
convert 12hrs as a 24hrs
Last edited by harikumar on Mon Jun 28, 2010 11:22 pm, edited 1 time in total.
There's no such thing as "20.30am" or "16.00pm", it's either 12 hour notation with AM/PM or 24 hour notation without it. Use StringToTimestamp() and then TimestampToString() with the appropriate Time Format string for each step, one to read it into internal format as 12hour and the other to write it back out to an external format using 24hour.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What's the data type of drawtime? Assuming it's a string, you can use Field() functions, arithmetic (add 12) and concatenation to build the desired output string.
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.
-
- Premium Member
- Posts: 138
- Joined: Wed Jul 16, 2008 9:51 pm
- Location: Kolkata
In this data, how do you differentiate between AM & PM?harikumar wrote:i have source like
balance,drawtime
20000, 8.30
50000,10.20
3000,4.00
Without that information the conversion would not be possible.
TONY
ETL Manager
Infotrellis India
"Do what you can, with what you have, from where you are and to the best of your abilities."
ETL Manager
Infotrellis India
"Do what you can, with what you have, from where you are and to the best of your abilities."
-
- Participant
- Posts: 9
- Joined: Sun Jun 27, 2010 11:52 pm
-
- Premium Member
- Posts: 138
- Joined: Wed Jul 16, 2008 9:51 pm
- Location: Kolkata
Not that simple I guess Venugopal. In 12 hour format without the AM/PM mentioned as it is the case with the source data example provided by Harikumar, 4:00 can be either morning or evening.venugopal.123 wrote:It is simple Tony drawtime between 00.01 to 11.59 is AM and 12.00 to 24.00 is PM
And one more thing is that 12:00 to 23:59 is not available in 12 hour format.
![Smile :)](./images/smilies/icon_smile.gif)
TONY
ETL Manager
Infotrellis India
"Do what you can, with what you have, from where you are and to the best of your abilities."
ETL Manager
Infotrellis India
"Do what you can, with what you have, from where you are and to the best of your abilities."
The original question has been edited from what was posted last night. All examples had an "am" or "pm" at the end, source and target, hence my comment which was speicific to the target 'needed'. The poster then over-reacted and removed too much in (what I assume was) an attempt to correct things. Now, as noted, the examples as posted are still invalid, just in a different manner.
Still doesn't change my answer.
![Evil or Very Mad :evil:](./images/smilies/icon_evil.gif)
Still doesn't change my answer.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers