time stamp conversion
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 397
- Joined: Wed Apr 12, 2006 2:28 pm
- Location: Tennesse
DSGuru i divided the field into 2 parts using the stage variables A and B , A contain Jul 7 1998 12:19:52:236 and B contain PM . i used your code on A i got the output as 1998-07-17 12:19:52 . i am not getting :000 even after usin .3 in format. How should i use B i,e PM/AM to get 24 hrs format?
hi sam here
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Use a Stage Variable:
sV >> If inTime = 'AM' then 1 else 0
In the Column Derivation:
Test this...
IHTH
sV >> If inTime = 'AM' then 1 else 0
In the Column Derivation:
Code: Select all
If sV = 0 then
Field(incol," ",1):" ":TimeFromMidnightSeconds(
(HoursFromTime(Field(incol," ",2)) * 3600) +
(MinutesFromTime(Field(incol," ",2)) * 60) +
(SecondsFromTime(Field(incol," ",2))) +
(12 * 3600)
)
else incol
IHTH
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
Thomas Alva Edison(1847-1931)
Where are you changing the format? The StringToTimestamp() changes the string into a timestamp. The format of the timestamp will depend upon the default that is set in your target stage. I hope you are giving the .3 in the default timestamp of the target stage.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Premium Member
- Posts: 397
- Joined: Wed Apr 12, 2006 2:28 pm
- Location: Tennesse